Thus wrote Jon,
Hello all,
I'm creating a file with the extension mai and the file contents are
in Japanese (シャーのエア抜き). Now the code works and creates the file, but
when I open it in Wordpad, the japanese text has become
シャーã®ã‚¨ã‚¢æ*œã .
Why is this and can anyone help?
It seems WordPad only recognizes UTF-8 encoded text when the file includes
a byte order mark (BOM). File.CreateText() creates UTF-8 encoded files without
a BOM.
Therefore, instead of
StreamWriter writer = File.CreateText("file.txt");
use
StreamWriter writer = new StreamWriter("file.txt", false, Encoding.UTF8);
to create your StreamWriter.
Cheers,
--
Joerg Jooss
ne********@joergjooss.de