Re: [xml] French character encoding problem



On Thu, Sep 15, 2005 at 12:17:34PM -0400, Fred Fung wrote:
Hi,
 
We are using libxml version 2.0.0 on Red Hat Linux Enterprise version 2.4.9.
 
I have an xml file with the first line specifying the encoding scheme :
 
         <?xml version="1.0" encoding="LATIN1" ?>

  Uing "LATIN1" is a very bad idea, it is absolutely not portable
  encoding="ISO-8859-1" is the right way.

and one of the text node in the file is the following :
 
         <FIRSTNAME>FRAN&#199;OIS</FIRSTNAME>

  Horror, uppercase tags !

 
After the document has been parsed via xmlParseFile( ) and xmlDocGetRootElement( ), a call to 
xmlNodeGetContent( ) returns "FRANÃîOIS" (a strlen of 9) instead of "FRANÃOIS".
...
Am I missing something in the C program to convert the encoded sequence to the origianl character ?

  Read the doc:
    http://xmlsoft.org/encoding.html

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]