Hi,

Kaustubh S. Deorukhkar wrote:
 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.

When you say get it back, what do you mean? If you transcode it then you will only be able see characters which are in your local code page. Other characters will seem "corrupt".




// ***********my code snippet******************
// mystring (having the unicode characters)

What type is mystring? What unicode characters does it have in?


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".

IE understands UTF8, that does not mean your console or whatever you are using to debug does. If you are saying that you can write the file and view it as expected what is wrong exactly?



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?


Xerces uses UTF-16 internally.



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]

Reply via email to