Hi,
writeNode writes UTF-8 codepoints, unless you set the encoding to be Shift-JIS using DOMWriter::setEncoding

Alberto


Lele, Parag wrote:

    I am trying to read Japanese String in an English locale.

    The node contains Japanese characters is sent to this function.

    As soon as I use getRawBuffer, the output contains garbled characters.

What is missing in the code? I want the original characters to remain same

void Node2String

{

DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(0);

DOMWriter* serializer = ((DOMImplementationLS*)impl)->createDOMWriter();

    try {

            MemBufFormatTarget *target  = new MemBufFormatTarget();

            serializer->writeNode(target, *node);

const XMLByte *output = target->getRawBuffer(); //here the characters are garbled

target->flush();

      serializer->release();

       }

}

The original text has Japanese characters but after using getRawBuffer() the output observed in debug mode is as follows

トップニューã




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to