[gdal-dev] Proposed UTF-8 SWIG Changes

Frank Warmerdam warmerdam at pobox.com
Mon Sep 27 10:31:33 EDT 2010


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.

In other languages there is no special processing except that I have also
globally applied the NONNULL typemap to such parameters.

If I got ahead with this, should I add utf8_path in the README.typemaps?

Best regards,
-- 
---------------------------------------+--------------------------------------
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 Programmer for Rent



More information about the gdal-dev mailing list