Re: [xml] How do I read German Umlaute - entities from an XML-File using libxml?



On Fri, Oct 05, 2001 at 02:52:46PM +0200, Matthias Peters wrote:
Hello,
The XML-Files that I generate contain German Umlaute (äöü  or ä ö 
¨).
I use a Function to convert them into a sequence like this:
ä ----> ä
ö ----> ö
and so on...
Now the Internet Explorer can read the XML-Files and display all the 
Umlaute correctly. However libXMLs "characters" call-back function does not 
convert the Umlaute the right way back. For instance "&#xe4" becomes "ä". 
Can anyone tell me, how to solve this problem? (Perhaps by a sample program 
that uses Umlaut-conversion?)

  First, read the documentation !!!
    http://xmlsoft.org/encoding.html

  The libxml callback gives UTF8 encoded strings. It seems taht you expect
ISO-8859-1 encoded ones. You need to convert between both. There is a routine
called isolat1ToUTF8, use it or change you program to use UTF8 encoding.

Daniel

-- 
Daniel Veillard      | Red Hat Network http://redhat.com/products/network/
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]