In my current situation, im dealing with an instance of DOMNode*, i looked
for a way to maybe convert it to an XMLCh* and then use XMLString::transcode
on it, but the only way i found to convert the DOMNode to XMLCh is using the
DOMWriter's "writeToString" function, but the problem is that it allways
uses UTF-16, so when i call it, all of my "exotic" characters turns into
garbage..

help? =\
Thanks for your reply

Boris Kolpackov-2 wrote:
> 
> Hi,
> 
> Here is one approach that might work:
> 
> 1. Serialize your XML into a memory buffer in UTF-16 encoding (
>    I think if you specify just "UTF-16" it will have the same
>    endian'ness as the machine on which this is performed, though
>    I am not 100% sure).
> 
> 2. Get the underlying buffer and cast it to XMLCh*.
> 
> 3. Call one of the XMLString::trascode functions to convert it
>    to a C-string in current/default encoding.
> 
> Boris
> 
> -- 
> Boris Kolpackov, Code Synthesis Tools
> Open source XML data binding for C++:  
> http://codesynthesis.com/products/xsd
> Mobile/embedded validating XML parsing:
> http://codesynthesis.com/products/xsde
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Converting-a-DOMNode-to-std%3A%3Astring-with-Default-OS-codepage-tp16236700p16269977.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.

Reply via email to