Now I'm making a program for creating language glossaries, but the problem is that windows uses ANSI for encoding text files, and the program that will read these files (which is not mine) only displays words in utf-8 encoding.
Since my program is multiplatform, it can also work under Linux. In Linux there is no problem at all, because it uses UTF-8 as default, so it works smoothly. The problem is Windows.
Right now I have this:
the program manages to take the words and convert them to utf-8, (or at least that's what I think, see code) then it writes them to the file, but when I open it under windows the character encoding is still ANSI.
I understand I need to turn the file into a UTF-8 file FROM Python (right now I have to open the file and change it myself, everything works fine after that.)
t = word.get() #I'm using tkinter, word is an entry field e = meaning.get() #I'm using tkinter, meaning is an entry field meaning.delete(0, END) word.focus() es = e.encode("utf-8") ts = t.encode("utf-8") es.decode("utf-8") ts.decode("utf-8") #then the usual write procedure whre I write es and ts to the file.