Parsing XML file with Chinese Character

  • Thread starter Thread starter csl
  • Start date Start date
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
 
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.)
 
If I open the xml document in IE, the characters display correctly. If I
read the same xml document using
XmlValidatingReader, it's showing "????".
 
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?
 
I am seeing this in the Console Output window. I will like to save the
parsed data in SQL Server 2000.
 
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
 
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.
 
Back
Top