I'm experiencing issues with special characters such as "é" in the XML output of the DOMWriter :
The following program outputs child1 as "text1" and child2 as "t?2"
Then if I try to read child2 it has the wrong text inside.
What should I do to be able to write then read back these special characters ?
int main(int argc, char** argv)
{
// build a DOM document and write it to standard output.
AutoPtr
AutoPtr
pDoc->appendChild(pRoot);
AutoPtr
AutoPtr
pChild1->appendChild(pText1);
pRoot->appendChild(pChild1);
AutoPtr
AutoPtr
pChild2->appendChild(pText2);
pRoot->appendChild(pChild2);
DOMWriter writer;
ASCIIEncoding encoding;
writer.setEncoding("Default", encoding);
writer.setNewLine("
");
writer.setOptions(XMLWriter::PRETTY_PRINT);
std::ofstream out("out.xml");
writer.writeNode(out, pDoc);
return 0;
}





