List Info

Thread: Problems with file names in UTF-8 on Windows




Problems with file names in UTF-8 on Windows
user name
2006-09-01 00:46:13
Hi Daniel,

Unfortunately, this patch breaks libxml2 when compiled on
Windows with
the Borland C compiler (and probably any other Windows
compiler which
uses its own IO library, rather than Microsoft's). The
FILE* returned
from the Windows _wfopen function is not compatible with the
Borland
fread, fwrite, fclose, etc. functions.

I am attaching a patch that avoids using _wfopen with the
Borland
compiler. It also corrects the mispositioned declaration of
osvi (this
is C code, not C++ !)

Eric Zurcher
CSIRO Plant Industry
Canberra, Australia
Eric.Zurchercsiro.au 

-----Original Message-----
>Date: Wed, 30 Aug 2006 09:13:27 -0400
>From: Daniel Veillard <veillardredhat.com>
>Subject: Re: [xml] Problems with file names in UTF-8 on
Windows
>To: Roland Schwingel <Roland.Schwingelonevision.com>
>Cc: xmlgnome.org
>Message-ID: <20060830131327.GC2303redhat.com>
>Content-Type: text/plain; charset=us-ascii
>
>On Wed, Aug 30, 2006 at 02:09:11PM +0200, Roland
Schwingel wrote:
>> Hi...
>> 
>> Daniel Veillard <veillardredhat.com> wrote on
21.08.2006 10:30:06:
>> > On Mon, Aug 21, 2006 at 10:18:26AM +0200,
Roland Schwingel wrote:
>> > > At present I am damned overloaded. I will
come back to your
messages 
>> > > ASAP...
>> > 
>> >   Thanks, hopefully within a couple of weeks
because pushing a new 
>> libxml2
>> > version out would make sense around the end of
the month.
>> 
>> Here is the reworked patch...
>> What has changed. It operates now in
"paranoid" mode...
>> 1) Handling of msvcrt moved (as requested by
Daniel) to an own static

>> function
>>    which is additionally secured against
threadingproblems with a
mutex.
>> 2) There is an additional check against the
Operating system version
to
>>    force win9x to use ascii mode.
>> 3) Added the MB_ERR_INVALID_CHARS to
MultiByteToWideChar() calls, 
>>    even IMHO not needed, because if it would
produce incorrect wchars
>>    a subsequent call operating on that result would
fail anyway,
forcing
>>    windows path to fallback to ascii mode.
>> 
>> The patch is again made against vanilla libxml2
2.6.26
>
>  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.
>
>    thanks a lot !
>
>Daniel
>


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )