G
Guest
(this is follow-on message to one posted yesterday)
I'm trying to reproduce the capabilities in both Notepad and Excel, whereby
a Unicode text file with Unicode characters can be converted to ANSI, while
still preserving the unicode characters within.
Specifically, I'm using the unicode character &x2022, which is a largish
bullet.
I've tried this:
_writer = new System.IO.StreamWriter( file, false, new UnicodeEncoding());
which creates the text file just fine with regards to the bullet character,
but in Unicode format with BOM and all. When I save this file to ANSI with
Excel or Notepad, life is good.
BUT, when I try this:
_writer = new System.IO.StreamWriter( file, false, new
UnicodeEncoding(false, false));
The BOM is gone (good) but the bullet character gets converted into another
character.
What magic does Notepad/Excel use to preserve the character but lose the BOM?
I'm trying to reproduce the capabilities in both Notepad and Excel, whereby
a Unicode text file with Unicode characters can be converted to ANSI, while
still preserving the unicode characters within.
Specifically, I'm using the unicode character &x2022, which is a largish
bullet.
I've tried this:
_writer = new System.IO.StreamWriter( file, false, new UnicodeEncoding());
which creates the text file just fine with regards to the bullet character,
but in Unicode format with BOM and all. When I save this file to ANSI with
Excel or Notepad, life is good.
BUT, when I try this:
_writer = new System.IO.StreamWriter( file, false, new
UnicodeEncoding(false, false));
The BOM is gone (good) but the bullet character gets converted into another
character.
What magic does Notepad/Excel use to preserve the character but lose the BOM?