DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13447>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13447 DOMWriter doesn't work correctly ------- Additional Comments From [EMAIL PROTECTED] 2002-11-22 16:36 ------- I have had a similar problem attempting to create UTF-8 output on RH Linux (7.3). I started by using writeToString() which I saw in the example code but inspection of the code showed that this always sets the encoding to UTF-16, whatever the encoding has been set to. There is a good reason for this: the method expects to produce a XMLCh string which has 16-bit chars. or this reason, I decided to leave the writeToString() method alone and use the code from within it to achieve what I wanted. So instead of this ... XMLCh* wideString = theSerializer->writeToString(*doc); I now use the following code which gets me what I want. I'd be interested to know whether this is a long term solution or is dangerous in any way. XMLCh tempStr[100]; XMLString::transcode("UTF-8", tempStr, 99); theSerializer->setEncoding(tempStr); XMLCh* wideString = 0; MemBufFormatTarget destination; bool retVal; try { retVal = theSerializer->writeNode(&destination, *doc); } catch (...) { retVal = false; } const char *charString = (retVal ? XMLString::replicate((char*)destination.getRawBuffer()) : 0); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
