You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Gabriel Deal <ga...@yellowleaf.org> on 2005/11/24 02:53:45 UTC

XalanDOMString, transcoding, and the local code page

I have a XalanDOMString and I want to get the data from it in UTF-8 or
UTF-16.  If I call XalanDOMString::transcode() it converts the data to my
local code page, which I assume changes based on the locale my app is
running in (correct?).  What is the best way to either make sure my local
code page is UTF-8 or do the conversion without involving transcoding to
my local code page?

If this sort of thing is documented somewhere, please point me to that.
The only documentation I've found is the doxygen and the samples.

thanks,
gabriel




Re: XalanDOMString, transcoding, and the local code page

Posted by David Bertoni <db...@apache.org>.
Gabriel Deal wrote:
> I have a XalanDOMString and I want to get the data from it in UTF-8 or
> UTF-16.  If I call XalanDOMString::transcode() it converts the data to my
> local code page, which I assume changes based on the locale my app is
> running in (correct?).  What is the best way to either make sure my local
> code page is UTF-8 or do the conversion without involving transcoding to
> my local code page?
> 

I don't know how you would ensure the local code page is UTF-8.  If you 
want to transcode to UTF-8, get a UTF-8 transcoder from Xerces-C and use 
that to transcode the UTF-16 code units.  There is a global transcoding 
service that is a member of XMLPlatformUtils.

Dave