Re: [xml] Problems with file names in UTF-8 on Windows
- From: Emelyanov Alexey <emal lim ru>
- To: xml gnome org
- Subject: Re: [xml] Problems with file names in UTF-8 on Windows
- Date: Wed, 16 Aug 2006 21:06:15 +0400
> Here comes my revised/extended patch.
> [...]
> Roland
>
Sorry, but it will not work:
1. function MultiByteToWideChar() in __xmlIOWin32UTF8ToWChar() converts
native string to unicode even if not all byte sequences are valid;
so, you need use flag MB_ERR_INVALID_CHARS to ensure,
that whole string looks like utf-8;
(but it not guarantee, that source string is really utf-8)
2. functions _wstat() / _wfopen() are implemented in msvcrt.dll on
Windows 9.x,
but they use unicode variants of Win32 API functions, which also
exists in
kernel32.dll, but simply returns error "not implemented";
IMHO, the only way to solve this problem is to
detect platform using GetVersionEx()
3. one time detection of function presence is good idea;
but can you reassure me, that using of static variables will not
led to problems in multithreaded environment?
may be, it is more safe to detect platform during
library initialization in main thread?
PS.
Probably, I am excessively fastidious. Sorry once again.
But I don't like that some functions in libxml become
platform dependent and use heuristic tricks.
Really include in documentation note about using
file names on different platforms?
Is finer decision possible?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]