Re: [xml] Converting to xmlChar type

On Mon, Feb 21, 2005 at 09:31:51PM +0100, Aron Stansvik wrote:
On Mon, 21 Feb 2005 11:55:53 -0600, Thomas Jones <admin buddhalinux org> wrote:
I think you should just be able to do:

doc = xmlParseFile(BAD_CAST GenDigSig::getGenDigSigXMLSource());

But I'm not sure it's a good idea. Could anyone more experienced
comment on this? I'm new to libxml2 myself.

  a char * in C has no precise meaning. It's a sequence of bytes ended by 0.
You need to know the encoding of that sequence of byte to handle them 
as charecters. an xmlChar * is a 0 terminated sequence of bytes
with an UTF8 encoding. This is documented !

Conclusion: you can use taht direct cast if you know the string encoding
    is UTF-8 (or ASCII which is a subset).


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]