Why will writeUTFBytes ruin non-English characters?

I am writing multilingual text in .txt files using AIR

fileStream.writeUTFBytes()

For English characters, everything works fine. But as soon as Chinese, Arab or any other non-English characters appear, the sentences are completely confused.

For instance:

对着 大叔 摄影师 的确 没 爱 ....

becomes

RESPONSE ± Π ±Π ° ÆÊ≤ ° ± Aa ....

How can this be fixed?

+4
source share
1 answer

writeUTFBytes will not ruin anything, since it does not process the content.
Whatever happens in the pipe comes out.

The text you send is most likely encoded in Unicode / UTF-8
Make sure you open the file with an editor that supports unicode (even Windows Notepad supports it, but by default it is ANSI compliant).

+3
source

Source: https://habr.com/ru/post/1307290/


All Articles