"Linda Chen" <li********@faa .gov> wrote in message news:16******** *************** *****@phx.gbl.. .
I need to write some unicode symbols such as degree symbol
(for example 36°) by using XMLTextWrite but couldn't make
it work. I found the degree char in unicode is '\u030A'
Your code looks fine, just verify that when you create the XmlTextWriter
that you do so with a Unicode encoding, for instance,
XmlTextWriter myWriter = new XmlTextWriter( fileStream,
new System.Text.Uni codeEncoding( ) );
If you want to hide the Byte Order Mark (BOM) then make sure that you
use the parameterized UnicodeEncoding contructor:
XmlTextWriter myWriter = new XmlTextWriter( fileStream,
new System.Text.Uni codeEncoding( false, false) );
If on the other hand, you're already doing this, then perhaps you are not
seeing the degree symbol because of the font used by your text editor.
If you turn on the Byte Order Mark,
XmlTextWriter myWriter = new XmlTextWriter( fileStream,
new System.Text.Uni codeEncoding( false, true) );
Then you should be able to load the resulting Unicode XML file into
Microsoft Word (it will auto-detect the encoding if a BOM is present)
as Unicode text. Next, change the Font to "Lucida Sans Unicode,"
and you should see the degree symbol (instead of the rectangle
that indicates that code point doesn't have a glyph in Windows'
current code page).
Derek Harmon