P
Peter Holschbach
Hi,
I have a UTF8 coded XML file, where I have to translate some text and save
it with another file name. The result shall be UTF8 coded.
Here what I did:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("xml_input.xml");
.....
XmlNode node = ..... // find the right node
node.InnerText = "°C"; // this is the short story, the translated text
is read out of an excel file
.....
StreamWriter sw = new StreamWriter("xml_output.xml", false,Encoding.UTF8);
xmlDoc.Save(sw);
sw.Close();
The result is a XML file with the "°" symbol as a 3 byte ANSI coded value
(EF BF BD) not like in the original file coded as a 2 byte UTF8 value (C2
B0).
What can I do to store the XML file in UTF8 ?
I have a UTF8 coded XML file, where I have to translate some text and save
it with another file name. The result shall be UTF8 coded.
Here what I did:
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load("xml_input.xml");
.....
XmlNode node = ..... // find the right node
node.InnerText = "°C"; // this is the short story, the translated text
is read out of an excel file
.....
StreamWriter sw = new StreamWriter("xml_output.xml", false,Encoding.UTF8);
xmlDoc.Save(sw);
sw.Close();
The result is a XML file with the "°" symbol as a 3 byte ANSI coded value
(EF BF BD) not like in the original file coded as a 2 byte UTF8 value (C2
B0).
What can I do to store the XML file in UTF8 ?