Hello everybody,
I'm having troubles loading a Xml string encoded in UTF-8.
If I try this code:
------------------------------
XmlDocument doc=new XmlDocument();
String s="<?xml version=\"1.0\" encoding=\"utf-8\"
standalone=\"ye s\"?><a>Schönb ühl</a>";
doc.LoadXml(s);
doc.Save("d:\\t emp\\test.xml") ;
------------------------------
What I get in the test.xml file is:
------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes "?>
<a>Schönbà¼hl</a>
------------------------------
I'm puzzled about two points in the test.xml file:
- What is the "" at the beginning?
- Why are the special chars double-encoded?
Am I missing some point? Is there any workaround?
Thanks in advance,
jmgonet.
I'm having troubles loading a Xml string encoded in UTF-8.
If I try this code:
------------------------------
XmlDocument doc=new XmlDocument();
String s="<?xml version=\"1.0\" encoding=\"utf-8\"
standalone=\"ye s\"?><a>Schönb ühl</a>";
doc.LoadXml(s);
doc.Save("d:\\t emp\\test.xml") ;
------------------------------
What I get in the test.xml file is:
------------------------------
<?xml version="1.0" encoding="utf-8" standalone="yes "?>
<a>Schönbà¼hl</a>
------------------------------
I'm puzzled about two points in the test.xml file:
- What is the "" at the beginning?
- Why are the special chars double-encoded?
Am I missing some point? Is there any workaround?
Thanks in advance,
jmgonet.
Comment