[gdal-dev] Proposed UTF-8 SWIG Changes

Tamas Szekeres szekerest at gmail.com
Mon Sep 27 11:26:03 EDT 2010


2010/9/27 Frank Warmerdam <warmerdam at pobox.com>

> Even, Tamas, Ari, Howard, and other SWIG wise men,
>
> I got lost last night in the SWIG typemaps we use for GDAL, but eventually
> I came up with a minimal patch that seems to make sense and work.  I would
> appreciate it if you guys could skim it and let me know if I'm doing things
> in a really wrong or dangerous way.
>
>  http://trac.osgeo.org/gdal/attachment/ticket/3766/utf8_swig.patch
>
> I am attempting to treat any const char * parameter named utf8_path via
> a custom typemap that uses the preexisting GDALPythonObjectToCStr() to
> convert it.  This appears to take regular strings, and unicode strings
> properly in Python.
>
>
Frank,

I don't really undestand what's wrong with this. Applying custom typemaps to
specific parameters is widely used in the bindings. Those languages will get
a warning if that typemap is not yet implemented which is a correct way to
notify there should something to be done for that language.


>
> If I got ahead with this, should I add utf8_path in the README.typemaps?
>
>
Yes, it should be documented here what to be implemented in the typemap
code. I would also be in favour of adding such typemaps for all other
methods requiring utf8 strings in the current interface.

Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100927/f1e298df/attachment.html


More information about the gdal-dev mailing list