> Have you tried the DOMDocument::setEncoding(XMLCh *) method?
No, it doesn't work.  :(  Still, there is "UTF-16" string in the output.

I'm creating DOMDocument like this:

DOMDocument *theDOM;
const XMLCh* encNameStr = XMLString::transcode("UTF-8");

XMLCh tempStr[100];
XMLString::transcode("Core", tempStr, 99);    
DOMImplementation *impl =
DOMImplementationRegistry::getDOMImplementation(tempStr);
theDOM = impl->createDocument(
        0,                    // root element namespace URI.
        MAKE_UNICODE_STRING("ROOT"),            // root element name
        NULL);// DOMDocumentType());  // document type object (DTD).
theDOM->setEncoding(encNameStr);

When using it like this:

//cout << rootNode;
std::ostringstream oss;
oss << rootNode;

it works fine (there is "UTF-8" instead of "UTF-16"), but it took about
2 minutes to compleate. I wonder where this repleacment happens?

Thank you very much,
Milan


Reply via email to