Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2092

xerser fails to write Mutibyte charater, ^Z appears while write call on Solaris

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • DOM
    • None
    • Solaris 11 sparc,
      Xerser version 2.11

    Description

      <?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>

      Attachments

        Activity

          People

            Unassigned Unassigned
            pvikas vikas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: