Re: [xml] Problems with file names in UTF-8 on Windows



On Thu, Aug 31, 2006 at 08:53:08PM +0400, Emelyanov Alexey wrote:
Here is the reworked patch...
What has changed. It operates now in "paranoid" mode...
[...]
Roland

Okay, this seems to answer all points raised in the past, and is
changing windows only code (except for the duplicate function removal),
so I applied it and commited it to CVS.

Daniel

Hi.

After updating the library works under Win 9x. Thank you.
Although code has become rather unclear...

Besides some problems are possible.
First, latest Microsoft compilers not use msvcrt.dll any more, and link
programs with msvcr70.dll, msvcr71.dll, msvcr80.dll etc.
Second, the dynamic loading will be used in the
static version of library too.

Probably, an alternative version of patch will be more acceptable.

Patched library was compiled with MSVC 5.0, MSVC 7.1, Mingw (gcc 3.4.2)
and was tested under Win 98, Win 2000 SP4, Win XP SP2.

Changes in comparison with version 2.6.26:
1. Platform specific code is moved to separate functions (opening
   of files and status information retrieving).
2. As xmlInitParser() should be called in multithreaded programs
   before use of any other library functions, detection of
   platform and appropriate API features is carried out in
   xmlRegisterDefaultInputCallbacks() and
   xmlRegisterDefaultOutputCallbacks().
   Thus there is no need to complicate a code,
   protecting it with the mutex.
   After initialization two static function pointers are
   used only for reading, therefore problems with
   multithreading will not arise too.
3. In function __xmlIOWin32UTF8ToWChar() flag MB_ERR_INVALID_CHARS
   is used for fast detection of filename native encoding.
   Also unnecessary increase of string buffer length is removed.
4. The dynamic loading of msvcrt.dll is not used at all.
   The functions _wstat()/_wfopen() exists even in
   msvcrt20.dll (Win 95 distribution).
5. Functions xmlMalloc()/xmlFree() are used instead of malloc()/free().
6. In a code the stat() calls are used. If there is _stat()
   function in C library, appropriate macros is defined.
7. Code is changed for Windows only.


  Roland's patch has been applied to CVS. So any further patch should
be against CVs head i.e. the version with Roland's code changes. This
would also help checking what you are really changing, please resubmit.
BTW Roland, if you could also check those (or others one Windows) 
I would feel more confident taking a decision as I just can't test those
patches.

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]