[Shapelib] Re: shapelib improvements

Mateusz Loskot mateusz at loskot.net
Thu Dec 6 08:12:45 PST 2007


Bram de Greve wrote:
> Mateusz Loskot wrote:
>>
>> Possible solution is to use Unicode-aware API availalbe on
>> Windows: _wfopen() (or CreateFile)
>> Some time ago I ported Shapelib to use wide-character versions of
>> I/O functions as I needed it on Windows CE (Unicode-only system).
>>
>> Unfortunately, I have lost these modifications but it isn't a big
>> deal to do it.
>
> I've done similar modification for pyshapelib (I choose _wfopen because
> that's similar to what Python does), but as Frank is going to implement
> CreateFile IO hooks anyway, I think we can rely on that.  As long as he
> uses the Unicode versions of it, that is =).

Yes, I think so too.

> However, it still isn't without issues:
> 
> The CreateFile IO hooks will still accept char* filenames, which would
> be OK if we would treat it as UTF-8 and decode it with
> MultyByteToWideChar.  But that would cause an assymetry with the
> (default) tradition IO hooks that use fopen and still treats the char*
> filenames as ANSI encoded (in whatever codepage is set by the
> regionale).  If it looks like a duck ...

Right, there is some inconsistency.
However, I can't see any better option.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Shapelib mailing list