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 Version 2

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 (last modified by invisibleroads)

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 (2)

comment:1 by invisibleroads, 12 years ago

Description: modified (diff)

comment:2 by invisibleroads, 12 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.