Re: [xml] LoadLibrary needs to be LoadLibraryA



On Wed, Feb 20, 2008 at 08:01:43AM +0100, Roland Schwingel wrote:

   Hi...
   >  When I tried to compile libxml on Windows along with my application
   that is built with 'UNICODE' defined (i.e. as a Unicode
   >  application rather than as an "ANSI" application),  I came across a
   problem in xmlmodule.c.
   >
   >
   >  With UNICODE defined, LoadLibrary is resolved to LoadLibraryW which
   expects to get 'const wchar_t*' rather than 'const char*'.
   > To avoid the problem,  we have to use LoadLibraryA explicitly.

  I have no idea what the difference is between LoadLibrary, LoadLibraryA
and LoadLibraryW ...

   >
   > Below is my trivial patch:
   [...]
   I  agree  that  the  explicitely  stating LoadLibraryA or LoadLibraryW
   would be best.
   But  IMHO  LoadLibraryA  would  be a bad idea. This would not allow to
   load modules
   located in pathes containing unicode characters.
   IMHO  interpreting  the  path as utf-8 and then converting it to wchar
   would be better
   and  then  trying  LoadLibraryW().  If the path cannot be converted or
   LoadLibraryW()
   fails  a second attempt can be made using the original argument of the
   xmlModulePlatformOpen
   function passed to LoadLibraryA(). For the utf-8 -> wchar thingy there
   is already code
   in xmlIO.c doing these things it should be recycled here.
   Roland

  Okay, I can't test this, someone comes with a complete patch and I can
review and apply it,

  thanks,

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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