[gdal-dev] Could not write Japanese characters in Shapefiles

Even Rouault even.rouault at spatialys.com
Sun Jul 7 02:29:27 PDT 2019


On dimanche 7 juillet 2019 08:34:03 CEST tor21sor at protonmail.com wrote:
> Hi,
> 
> Great to find an awesome geospatial library!
> 
> I could read the field names of a shapefile in Japanese characters by
> applying the following setting in Python 3 program.
> os.environ['SHAPE_ENCODING'] = "Shift_JIS"

For writing, this needs to be defined as the layer creation option ENCODING of 
CreateLayer()

lyr = ds.CreateLayer(layer_name, geom_type, srs, options = ["ENCODING=SJIS"])

This will write a .cpg file with "SJIS" inside.

Or "ENCODING=LDID/19". The later will not write any .cpg file at all.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list