You can transcode to any encoding, but the transcode() call on
XalanDOMstring transcodes to the local code page. As I said before, if the
local code page does not support that character, you cannot transcode the
string to it. If a code page cannot represent a character, there's no
other solution.
If you want to transcode to something else, like iso-8859-1, you'll need to
get a transcoder for the encoding and transcode the string. Whether or not
your environment supports and can display that encoding, I don't know. See
the Xerces documentation for more information on transcoding, or search the
source files for examples.
Xalan has a collection of serializers that you can use if you want to
serialize an entire document, or sub-tree, but it's overkill for simple
string transcoding.
Dave
|---------+-------------------------------->
| | Vincent Berruchon |
| | <vincent.berruchon@si|
| | -logism.fr> |
| | |
| | 04/11/2002 08:32 AM |
| | Please respond to |
| | xalan-dev |
| | |
|---------+-------------------------------->
>---------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED], Vincent Berruchon
<[EMAIL PROTECTED]> |
| cc: (bcc: David N Bertoni/Cambridge/IBM)
|
| Subject: Re: accent
|
>---------------------------------------------------------------------------------------------------------------------------|
I'm working on Linux (Mandrake 8.1) with gcc-2.96 and xalan-c1.3
XalanDOMString str = DOMServices::getNodeData(*nodeList.item(i));
str.length() give me the correct length
As you write it I cannot transcode as soon as the string contains and
accent or special character.
for exemple if I use "str.transcode()", the program output on the screen
"Abandon" and exit.
I'd like to get an char** from my XalanDOMString... but I must transcode
it??
(to get a char* from a XalanDOMString I use the c_ str(str.transcode(),
c_str from DOMStringHelper )
There's really no solution?
I've seen that some XMLFormatter exists in Xerces.. can it be useful?
Thanks
Vincent
-----
HI Vincent,
You cannot transcode a character to the local code page unless that code
page supports the character. Apparently, the local code page of your
system cannot represent some of the characters you are using. Thus, you
get nothing from the string, since it cannot be transcoded correctly.
This is a very common occurrence, and there's really no way around it,
unless you have a system in which the local code page is UTF-8, UTF-16, or
UTF-32. (I don't know of any such system.)
Dave
> ---------+-------------------------------->
> > Vincent Berruchon |
> > <vincent.berruchon@si|
> > -logism.fr> |
> > >
> > 04/10/2002 10:08 AM |
> > Please respond to |
> > xalan-dev |