Re: [xml] Encoding problems building document from scratch

On Mon, Jan 14, 2002 at 04:39:15PM +0100, Henke, Markus wrote:
And what's the correct way to set an encoding for a new document?

  set doc->encoding

  You need to convert first the string to UTF8. There is a function
exported from encoding.h to do IsoLatin1 to UTF8 encoding.

Hum, that's of course an option.

  No it's the only option. libxml2 API strings are UTF8 encoded, there
is no way around this. If you have a requirement for another encoding,
encapsulate libxml2 calls with them. Having libxml2 expose incoherent
API is not needed (there is enough of them), there is also a performance
issue when delegating charset conversions to libxml2.


Daniel Veillard      | Red Hat Network
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]