Re: [Evolution-hackers] XML APIs in evolution



On Wed, 2007-05-30 at 16:42 +0200, Gilles Dartiguelongue wrote:
> The question is, what shall we do now ?

The need for a cast is part of the (IMHO wrong) design of libxml2, the
policy is that the libxml2 API requires UTF-8 strings, so they typedef
xmlChar to unsigned char*.  Application writers are then meant to run
all strings through UTF-8 conversion, or use xmlChar* if they know the
string is UTF-8.

Of course:

1. This breaks ASCII and UTF-8 string literals
2. GNOME uses char *UTF-8 strings internally, so the strings are always
valid

Sadly the correct solution is to cast everything to xmlChar*. :( If
there are some strings which are only used with the libxml2 functions
then declaring their type as xmlChar is better.  

I'll happily review a patch for evolution-data-server/addressbook
because the warnings there have been driving me insane recently.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Attachment: signature.asc
Description: This is a digitally signed message part



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