Opened 12 years ago

Last modified 9 years ago

#4608 closed defect

GDAL 1.9.0 for Python 2.7.2 does not support native unicode — at Initial Version

Reported by: invisibleroads Owned by: hobu
Priority: normal Milestone: 2.0.0
Component: PythonBindings Version: 1.9.0
Severity: normal Keywords: unicode utf-8 utf8 SetField GetField
Cc:

Description

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

Change History (0)

Note: See TracTickets for help on using tickets.