[ http://issues.apache.org/jira/browse/XERCESC-1468?page=comments#action_12318274 ]
Manfred Egger commented on XERCESC-1468: ---------------------------------------- OK, I see. Solved this Issue with a MemBufFormatTarget > Wrong encoding in output > ------------------------ > > Key: XERCESC-1468 > URL: http://issues.apache.org/jira/browse/XERCESC-1468 > Project: Xerces-C++ > Type: Bug > Components: DOM > Versions: 2.6.0 > Reporter: Manfred Egger > > Add the following Code to the CreateDOMDocument example on Line #175: > DOMWriter *writer = impl->createDOMWriter(); > if (writer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint,1)) { > writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,1); > } > writer->setEncoding(XMLUni::fgISO88591EncodingString2); > StdOutFormatTarget target ; > writer->writeNode(&target,*doc); > writer->release(); > Now you should get the following output: > <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> > <company> > <product>Xerces-C</product> > <category idea="great">XML Parsing Tools</category> > <developedBy>Apache Software Foundation</developedBy> > </company> > If you now replace the two lines > StdOutFormatTarget target ; > writer->writeNode(&target,*doc); > with > std::cout << XMLString::transcode(writer->writeToString(*doc)); > then you should get the same content as above but with encoding="UTF-16" > which is wrong. > How can this problem be solved? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
