Re: [xml] Encoding - from what to UTF8 ??

On Mon, May 23, 2005 at 10:05:50AM +0200, Remy HAREL wrote:
  Yet I also use many others source files encoded with many differents 
encodings :

iso-8859-X ( where X = 1, 2, 5, 6, 14, 15 )
cpXXXX ( can't remember the exact name, but it corresponds to Russian ).

  So, my question is "does libxml2 provide functions to convert a 
source text from one of these languages to UTF8, or there is a simple 
way to do that ?"

  The answer is no. Libxml2 has hard coded support for UTF-8, UTF-16 and
the iso-8859-x the 2 first ones being the only mandatory encodings an
XML parser must support. For everything else it uses iconv() if found
at compilation time.
  The API you're looking at is iconv:
It's available on all serious OSes, and Igor ships a Win32 precompiled
versions. The set of encoding supported might be platform dependant though
and the quality of the converters may also be system dependant, but 
that's the API to use. There is a free software implementation:


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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