[gdal-dev] UTF-8 strings being re-encoded to LATIN1 with ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Mon May 9 09:52:06 EDT 2011

On 11-05-09 08:24 AM, Christy Nieman wrote:
> Hello,
> I compiled gdal from trunk last week, and noticed that ogr2ogr keeps converting
> UTF-8 strings to LATIN1. The only thing I've been able to find that's remotely
> related to this is OGR_EDIGEO_RECODE_TO_UTF8 at the bottom of
> http://trac.osgeo.org/gdal/wiki/ConfigOptions which appears to be a way to
> prevent the opposite of what is happening. Tested with 1.8 and it works as
> expected (i.e. UTF-8 string stay in UTF-8).
> Has anyone else seen this?


Are you speaking about with shapefiles?  Recently a first effort was made to
apply encoding conversions to and from shapefiles.  There is a configuration
options for the shapefile driver that can be used to override it's concept
of what the encoding of the shapefile is or should be.  If you want to avoid
conversions you should be able to set it to "UTF-8".


ogr2ogr --config SHAPE_ENCODING UTF-8 out.shp in.mif

If it is another driver you are working with then you will need to be

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