Trying to make a thai translator in Python, but am unable to write using Thai characters
<p>I am trying to make a thai translator, but am unable to write using Thai characters. 
I saw somewhere to do this to check what the default encoding is:</p>

<pre><code>import sys; print(sys.getdefaultencoding())
</code></pre>

<p>I get utf-8 </p>

<p>My problem is that I just get ?? when I use Thai characters. Is there a way that I can use them? A different question I am trying to translate a sentence and was wondering how to put a space in between words. As of right now I just get all the words combined in the .txt file. </p>

<pre><code>s = shelve.open("THAI.dat")
s[entry]=define
text_file = open("THAI.txt", "w+")
num = int(input("How many words are in sentence"))

while num != 0:
    trys = input("Input english word")
    if trys in s:
        print(s[trys])
        part = s[trys]
        text_file.write(part)
        num -= 1
</code></pre>
