[xml] Newbie question: how strict should usage of xmlChar be?



I've got an app that uses libxml2; I didn't write it, but I'm maintaining it. I'm wondering, since the app contains a variety of direct casts to and from xmlChar, how strict should this be?

I see that the library contains xmlCharStrdup for converting a char * to xmlChar *, but I also see from the header files that xmlChar is just an "unsigned char" anyway, so converting from char * to xmlChar * is a safe cast. Are there environments where this is not the case, or is it planned that libxml2 may use something other than "unsigned char" for xmlChar in the future?

I guess my concern is if doing these direct casts will impact libxml2's abiliity to handle XML streams that have been encoded using something other than ISO-8859-1. I have a lot of places where I need to supply element/attribute names to libxml2 calls, and if I have to xmlCharStrdup/xmlFree each one of them I can do that, but I want to make sure I'm not wasting my time and energy :-)




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