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            |
|         |                                |
|---------+-------------------------------->
  
>---------------------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                                       |
  |        To:      [EMAIL PROTECTED], [EMAIL PROTECTED]                       
                                       |
  |        cc:      (bcc: David N Bertoni/Cambridge/IBM)                               
                                       |
  |        Subject: accent                                                             
                                       |
  
>---------------------------------------------------------------------------------------------------------------------------|



  Hello everybody,
I try to use XPath to get value of node data in XML File.
I'm french so most of the time I prefer use  iso-8859-1 encoding in my
XML Files. There are often accents in these files.

In my test, these line allow me to get the Node list corresponding to
the Xpath
   const NodeRefListBase& nodeList = theEvaluator.selectNodeList(
                                  theHelper->getDOMSupport(),
                                  theContextNode,
                                  XalanDOMString(c_xpath).c_str(),

(_parsedSource.getDocument())->getDocumentElement());

The problem is that when I "cout" the XalanDOMString or CharVectroType
(I try to use TranscodeToLocalCodePage() it's the same) I get from this
Nodes, it's working only when there is no accent in the string otherwise
the output is blank (it writes nothing).

As soon there is one accent or "strange" character, the output of the
value for the Node is blank

So my questions are:
is this normal and is it a problem from XalanDOMString or something else?
How to take in account the encoding of the xml file if it's not by default?
I wait for your advices or ressources.

Thanks
Vincent






Reply via email to