Perhaps your code is not taking into account that a 16-bit encoding is likely to have embedded 0 bytes? That will certainly stop C-style strings from being written correctly. Also, you must write to a stream opened for binary access, not text.
Dave Indrajit Chaudhuri <[EMAIL PROTECTED] To: xercesdev <[EMAIL PROTECTED]> bal.co.in> cc: (bcc: David N Bertoni/CAM/Lotus) Subject: Problem with languague encoding in Xerces C Parser 1.2.0a 09/22/2000 03:12 AM Please respond to xerces-dev Hi, I was trying to parse a XML file with encoding UTF-8 and print it to a file with encoding UTF-16[BL]E using the DOMPrint Example given with the sample. I am using NT version of Xerces C Parser 1.2.0. But the output is not a valid a XML. I feel that some portion of the data are truncated out. For example my input file was <?xml version='1.0' encoding="utf-8" ?> <tag1> <tag11 attr1="id" > <tag111> abc </tag111> </tag11> </tag1> I got the following output with UTF-16LE <1"U" <t> <t a="i"> <t> <t> <t> <t> With UTF-16LE encoding, I am not at all getting a output. Could anybody put some light on this matter. Regards, Indrajit