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 shtirlic <kr...@yahoo.com> on 2008/08/18 20:45:36 UTC

Xserces Umlaut Problem C++ UNIX Solaris 8

Hi,
i have quite simple problem in C++ to create an xml with German Umlauts:

 DOMDocument* doc = impl->createDocument(
                           0,                    // root element namespace
URI.
                           X("company"),         // root element name
                           0);                   // document type object
(DTD).

               DOMElement* rootElem = doc->getDocumentElement();
               DOMElement*  prodElem = doc->createElement(X("product"));
               rootElem->appendChild(prodElem);
               DOMText*    prodDataVal = doc->createTextNode(X("Xerces-C"));
               prodElem->appendChild(prodDataVal);
               DOMElement*  catElem = doc->createElement(X("category"));
               rootElem->appendChild(catElem);
               catElem->setAttribute(X("idea"), X("great"));
               DOMText*    catDataVal = doc->createTextNode(X("XML Parsing
Tools"));
               catElem->appendChild(catDataVal);
               DOMElement*  devByElem =
doc->createElement(X("developedBy"));
               rootElem->appendChild(devByElem);
               DOMText*    devByDataVal = doc->createTextNode(X("ApĆ¼che
Software Foundation"));
               devByElem->appendChild(devByDataVal);

               DOMWriter*  _theSerializer;
               _theSerializer = impl->createDOMWriter();
               _theSerializer->setEncoding(X("iso-8859-1"));
              
if(_theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
                    
_theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
                _theSerializer->setFeature(XMLUni::fgDOMXMLDeclaration,
true);
                XMLFormatTarget *myFormTarget;
                myFormTarget = new LocalFileFormatTarget(X("test333"));
                _theSerializer->writeNode(myFormTarget,*doc);

The problem is that after running (Solaris 8) it german umlaut characters
are replaced by "|"

So the output actually looks like:

<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<company>

  <product>Xerces-C</product>

  <category idea="great">XML Parsing Tools</category>

  <developedBy>Ap|che Software Foundation</developedBy>

</company>

Any help will be appretiated.
thanks
-- 
View this message in context: http://www.nabble.com/Xserces-Umlaut-Problem-C%2B%2B-UNIX-Solaris-8-tp19035867p19035867.html
Sent from the Xerces - C - Dev mailing list archive at Nabble.com.


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