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 "Scott Cantor (JIRA)" <xe...@xml.apache.org> on 2017/07/12 17:05:00 UTC

[jira] [Resolved] (XERCESC-2092) xerser fails to write Mutibyte charater, ^Z appears while write call on Solaris

     [ https://issues.apache.org/jira/browse/XERCESC-2092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Scott Cantor resolved XERCESC-2092.
-----------------------------------
    Resolution: Invalid

You're transcoding data from UTF-8 into a local code page, that's not always going to produce sensible output.

> xerser fails to write Mutibyte charater, ^Z appears while write call on Solaris
> -------------------------------------------------------------------------------
>
>                 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.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org