I am using DOMWriter to write to file. What I see now is that I add the transcoded data to DOMDocument(root) and if I retrieve it even before writing to file, I see that data is corrupt. So my understanding is that data gets corrupted in memory, may be bcoz it is not properly encoded in UTF8. Probably transcode is failing as you pointed out.
Also to add, this works on Windows2K with default locale as English(all asian packs installed), but fails on Windows with default locale set as Japanese.
Is there some alternative to transcode which I can use. sample code snippet would be very useful if possible.
// ***********my code snippet******************
// mystring (having the unicode characters)
XMLCh* myUnicodeForm;
myUnicodeForm = XMLString::transcode(mystring);
// add myUnicodeForm to DOMDocument
// retrieve myUnicodeForm which is corrupt ***********
// write to file using DOMWriter
// ***********my code snippet******************
Additional info: if I save these characters in file in UTF8 format and view it in IE6, I am able to view the characters as expected, So I think the code page containing this characters is present on the machine. Also could you please throw some light on what does it exactly mean by "local code page".
Also 1 doubt: How does xerces store data in-memory whether in UTF-16 or UTF-8 in DOM tree?? Or what is the format in which transcode will return XMLCh*, which can the be added to DOM tree as DOMText?
Thanks and regards,
Kaustubh
On Sun, 02 Apr 2006 Gareth Reakes wrote :
>Hi,
>
>Kaustubh S. Deorukhkar wrote:
>> Â Hi,
>> I am facing issues writing unicode data to xml file in UTF8 encoding. Application can write most of the unicode chars, but for some chars as mentioned below the data is garbled. The sample data contains following characters
>>ï¿® (Unicode 0xffee)
>>é· (Unicode 0x9dd7)
>>
>>I am using XMLString::transcode before adding the node to DOM tree and then writing to file. Using xerces verion 2.5. Has anybody faced such problem. Any pointers would be very helpful.
>>Thanks in advance.
>>Kaustubh
>
>
>You are transcoding to your local code page which may not support those characters. Use DOMWriter instead.
>
>Gareth
>
>
>-- Gareth Reakes, Managing Director Embrace Mobile
>+44-1865-811197 http://www.embracemobile.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
- problem writing unicode data to xml file Kaustubh S. Deorukhkar
- Re: problem writing unicode data to xml file Gareth Reakes
- Re: Re: problem writing unicode data to xml fi... Kaustubh S. Deorukhkar
- Re: problem writing unicode data to xml fi... Gareth Reakes
- Re: Re: problem writing unicode data to xml fi... Kaustubh S. Deorukhkar
- Re: problem writing unicode data to xml fi... Gareth Reakes
- Re: problem writing unicode data to xm... Gareth Reakes
- Re: Re: problem writing unicode data to xml fi... Kaustubh S. Deorukhkar
- Re: Re: problem writing unicode data to xml fi... Kaustubh S. Deorukhkar
