Parsing XML file with Chinese Character

C

csl

I have to open and parse an xml file (with some xml elements in Chinese) in
C#, VS2003. I can open the file. However, when I read the xml elements,
it's showing "?????". Am I doing something wrong and how can I fix it?

Thanks,
Chris
 
J

Jon Skeet [C# MVP]

csl said:
I have to open and parse an xml file (with some xml elements in Chinese) in
C#, VS2003. I can open the file. However, when I read the xml elements,
it's showing "?????". Am I doing something wrong and how can I fix it?

Well, how are you viewing it? It's as likely to be in the viewing as
the parsing. (More likely, actually.)
 
C

csl

If I open the xml document in IE, the characters display correctly. If I
read the same xml document using
XmlValidatingReader, it's showing "????".
 
J

Jon Skeet [C# MVP]

csl said:
If I open the xml document in IE, the characters display correctly. If I
read the same xml document using
XmlValidatingReader, it's showing "????".

To repeat my question: how are you viewing it? You've said "It's
showing ????" but not explained what "it" is. The debugger? Console
output? A text file you've written to?
 
C

csl

I am seeing this in the Console Output window. I will like to save the
parsed data in SQL Server 2000.
 
C

csl

I can get the HEX code and they match unicode chart. Should I store the HEX
code in SQL Server 2000? Do I need to use special collation? And how do I
retrieve and display the characters correctly?

Thanks,
Chris
 
J

Jon Skeet [C# MVP]

csl said:
I can get the HEX code and they match unicode chart. Should I store the HEX
code in SQL Server 2000? Do I need to use special collation? And how do I
retrieve and display the characters correctly?

If the characters match the unicode chart, that should be fine - so
long as the columns are set up appropriately in SQL Server, you should
be able to store and fetch them with no problem. Just don't expect to
display the Chinese characters on the console.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top