[gdal-dev] Re: Are unicode field values supported in the Python bindings for GDAL?

Roy Hyunjin Han starsareblueandfaraway at gmail.com
Wed Apr 11 08:52:55 EDT 2012


I submitted a ticket to address this issue.
http://trac.osgeo.org/gdal/ticket/4608

RHH



"""
Currently, using the Python SWIG bindings for GDAL 1.9.0,

  feature.SetField(0, u'xxx')

  feature.SetField(0, 'Спасибо'.decode('utf-8'))

raise the following exception

  NotImplementedError: Wrong number of arguments for overloaded
function 'Feature_SetField'

Meanwhile, feature.SetField2() forcibly converts the string to ascii
using str().

Ideally,

  SetField() should accept native unicode

  SetField2() should accept native unicode

  GetField() should return native unicode

  GetFieldAsString() should return native unicode

References:

  http://lists.osgeo.org/pipermail/gdal-dev/2010-September/026156.html

  http://trac.osgeo.org/gdal/wiki/rfc5_unicode
"""


More information about the gdal-dev mailing list