Hello,
I’m trying to save a UTF8 file. This is what I’m doing:
plugins.file.writeTXTFile(fileName, txtData, "UTF-8", "text/plain");
but instead of, for eg, ‘Bätjer, Jörg’ I get this ‘B√§tjer, J√∂rg’
if I use ISO-8859-1 I get in the file this text: ‘B‰tjer, Jˆrg’
So, anyway I do it it’s wrong. How can the correct text can be saved in the file?
Thanks,
Bogdan.
how do you test the contents of that file again?
with what kind of editor? Does that editor use utf8?
With TextEdit from mac. I used it also when editing manual the i18n files, so I think it’s OK.
But right now I opened with notepad++ and there it look OK and the charset of the file is UTF-8.
It’s strange why TextEdit doesn’t sees it right !?
no not really strange, it is not really easy to detect this, i guess textedit just always uses the default encoding of the system for txt files.
You really have to build in code to scan the file to see if it is utf-8. There is no such thing as a property or description inside a text file that tells the editor the encoding.