xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alberto Massari <amass...@progress.com>
Subject Re: transcoding string with EUC-JP characters
Date Tue, 06 Apr 2004 13:13:20 GMT
At 05.43 06/04/2004 -0700, P M S Prakash wrote:
>Hi all,
>How do I transcode string with EUC-JP characters?
>Since XMLString::transcode does not support
>non-english code pages,

That's not true; XMLString::transcode uses the local code page of your 
machine, so if you are using a Japanese Unix machine with the correct code 
page installed, it should just work.

>I wanted to use ICU
>transcoder, I could not find any examples in using ICU
>I tried to use UnicodeString to represent the japanese
>string, but the XML transcoder does not accept this
>UnicodeString str("&#12486;&#12473;&#12488;");
>XMLCh* value = XMLString::transcode(str);

Why are you creating a Unicode string to transcode into Unicode? If you 
have an EUC-JP string you need a buffer like

char str[]="\xC0\xEC\xCC\xE7\xB2\xC8\xA5\xE5\xA5\xB9\xA5\xC8";

>I could not find any ICU transcoder. Is there one? How
>to use them.

What do you mean with "any ICU transcoder"? ICU is a library that you can 
download from http://www-124.ibm.com/icu/ and it contains a lot of 
transcoders bundled inside it.

>Also, I am encoding an xml document using Base64
>encoding, which returns XMLByte. How do I convert them
>to char, as I need to send them to a web service thro'

Just cast the XMLByte* buffer to char*; XMLByte is simply a typedef for 
unsigned char.


>Any inputs on this will be of great help.
>Do you Yahoo!?
>Yahoo! Small Business $15K Web Design Giveaway
>To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
>For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org

View raw message