Re: [xml] LoadLibrary needs to be LoadLibraryA

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

   >  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
   fails  a second attempt can be made using the original argument of the
   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.

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



Red Hat Virtualization group
Daniel Veillard      | virtualization library
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]