You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "vikas (JIRA)" <xe...@xml.apache.org> on 2017/05/02 10:19:04 UTC
[jira] [Created] (XERCESC-2092) xerser fails to write Mutibyte
charater ^Z appears while write call
vikas created XERCESC-2092:
------------------------------
Summary: xerser fails to write Mutibyte charater ^Z appears while write call
Key: XERCESC-2092
URL: https://issues.apache.org/jira/browse/XERCESC-2092
Project: Xerces-C++
Issue Type: Bug
Components: DOM
Environment: Solaris 11 sparc,
Xerser version 2.11
Reporter: vikas
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<testxml>
<IDList>
<ID dentifier="demo1" Name="demo1"> </ID>
<ID dentifier="demo2" Name="好的我"> </ID>
</IDList>
</testxml>
Sample code used to Write this sample xml,
impl = DOMImplementationRegistry::getDOMImplementation(tempStr);
theSerializer = ((DOMImplementationLS *)impl)->createLSSerializer();
theSerializer->setNewLine(xercesc::XMLString::transcode("\n"));
bufferTarget = new MemBufFormatTarget();
theOutput = ((DOMImplementationLS*)impl)->createLSOutput();
theOutput->setByteStream(bufferTarget);
theOutput->setEncoding(XMLString::transcode("UTF-8"));
theOutput->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
theOutput->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint, true);
theSerializer->write(m_doc, theOutput);
std::string dump_xmlstring = std::string (xercesc::XMLString::transcode(bufferTarget->getRawBuffer()));
std::cout << dump_xmlstring <<std::endl;
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<testxml>
<IDList>
<ID dentifier="demo1" Name="demo1"> </ID>
<ID dentifier="demo2" Name="^Z^Z^Z"> </ID>
</IDList>
</testxml>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org