[Shapelib] Re: shapelib improvements

Tom Kazimiers 2VooDoo at gmx.de
Thu Dec 6 11:46:29 EST 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.

I had this problem, too, as I needed to use this lib on win CE.
And ported shapelib to unicode. If you want, I can send the sources.

> 
> > 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.

But if you use shapelib as a dll from another program, esp. a managed code one (I use C#) - on windows CE you have the only option to call with unicode parameters. This means you have to write wrappers which to the transformation or one makes the dll unicode aware (this is what I did).
Are there any ways to get a managed to unmanaged call on Win CE working with char?

bye
Tom

-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger


More information about the Shapelib mailing list