[gdal-dev] GDAL/OGR C# wrapper and UTF8

Tamas Szekeres szekerest at gmail.com
Wed Apr 3 12:54:41 PDT 2013


Frank,

We seem to consider only a subset of the parameters (filenames and fileds)
that should be utf8 encoded. But it seems that's not enough. For example
treating fields as utf8 would also require to modify SetAttibuteFilter to
provide match with the same value returned from GetFieldAsString. In this
regard that would be more sufficient to treat all strings as being utf8 in
GDAL. With regards to C# that would mean to convert all strings between
Unicode and UTF8.

Best regards,

Tamas




2013/4/3 Frank Warmerdam <warmerdam at pobox.com>

> Guys,
>
> Certainly the intention of RFC 23:
>
>   http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode
>
> Was that we consider OGR string fields to be utf8 and I believe that
> should be the default assumption.
>
> Best regards,
> Frank
>
>
>
> On Wed, Apr 3, 2013 at 12:17 PM, rburhum <ragi at burhum.com> wrote:
>
>> Hello Tamas and Dennis,
>>
>> This is my personal opinion and there may tons of people that disagree,
>> but
>> I think it is more sane to always assume UTF8 encoding. There is
>> functionality among the various drivers to accept/return strings in
>> different encodings (through the CPL_Recode mechanism) but they all do it
>> with different parameters (e.g. "PGCLIENTENCODING" in PostgreSQL,
>> "SHAPE_ENCODING" in ESRI Shapefiles, etc). Overly complicated for
>> programmatic access.
>>
>> Strings being set should use UTF8 encoding. Strings being read should
>> assume
>> UTF8 encoding. Not sure about the column names, layer names and such, but
>> I
>> would rather find the drivers that are not assuming utf8 and fix those
>> than
>> doing some extra complicated magic in the C# bindings. It simplifies logic
>> greatly.
>>
>> If the underlying data store is using Windows-1252 encoding internally,
>> that
>> should be handled and abstracted out by the driver itself (by doing the
>> conversions into utf8), not the bindings.
>>
>> My two cents,
>>
>> - Ragi
>>
>>
>>
>> --
>> View this message in context:
>> http://osgeo-org.1560.n6.nabble.com/gdal-dev-GDAL-OGR-C-wrapper-and-UTF8-tp5044028p5044395.html
>> Sent from the GDAL - Dev mailing list archive at Nabble.com.
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
>
> --
>
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Software Developer
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130403/49fb1314/attachment.html>


More information about the gdal-dev mailing list