[Shapelib] Re: shapelib improvements

Bram de Greve bram.degreve at bramz.net
Thu Dec 6 14:14:53 PST 2007


Tom Kazimiers wrote:
> Mateusz Loskot schrieb:  
>   
>> Tom,
>>
>> Perhaps we could make a unicode branch of Shapelib.
>> Frank's opinion is most important here, not mine
>>   
>>     
> This would be a good thing
>   
>>> 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?
>>>     
>>>       
>> Doesn't marchaling to UnmanagedType.LPStr work?
>> Also, CharSet attribute of DLLImport to control how encoding information
>> is marshalled. CharSet.Ansi is default for C++, so Unicode->ANSI is
>> translated automatically.
>>
>> Cheers
>>   
>>     
>
> Sure it is on a "normal" desktop computer - but in Win CE environment
> one can only choose CharSet.Unicode as the whole OS works only with unicode.
> The UnmanagedType.LPStr I did not try out - I will test it. But since I
> have read that Win CE can only handle unicode I doupt it  would work.
>
> Bye
>   

It might solve your problems with unicode filenames, but how will you
cope with textual content?  You will need to build in all your encodings
as internally all textural content is char* exclusively (with various
encodings).  That can be done?

Also, I suggest to first consider if you can't solve your problems with
wrapper code.  Not wrapper code around the DLL, but building a unicode
DLL with wrapper code around the original.  That way, you don't have to
branch (or to fork), which might be beneficial to both ...

Bram



More information about the Shapelib mailing list