[mapserver-users] Encoding issues

Tamas Szekeres szekerest at gmail.com
Wed Mar 11 14:54:16 PDT 2009


2009/3/10 Murty Maganti <MMaganti at oriongis.com>

>  Hi
>
>
>
> As per the code documentation in the method msGetEncodedString (as shown
> below), the characters are assumed to be UTF-8 by default.
>
>
>
> char *msGetEncodedString(const char *string, const char *encoding)
>
> {
>
> ---
>
>   if (len == 0 || (encoding && strcasecmp(encoding, "UTF-8")==0))
>
>       return strdup(string);    /* Nothing to do: string already in UTF-8
> */
>
>
>
> Where as in the ‘values’ property of shapeObj.cs in C#, it is using
> System.Runtime.InteropServices.Marshal.PtrToStringAnsi  (to marshal
> characters from c to c#). Shoudn’t it be using
> System.Runtime.InteropServices.Marshal.PtrToStringUni method since as the
> charcters are by default held in UTF-8 encoding?
>
>
I don't think so. These 2 representations are quite different. UTF-8 use 8
bit representation with varying character length (1-4) , while unicode use
16 bit / character by default.
msGetEncodedString is used to transform the labels during the drawing in case
if the encoding parameter is specified, but this function haven't been
utilized when retieving the shape values.


Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090311/a793cc93/attachment.htm>


More information about the MapServer-users mailing list