I'm trying to convert my shapefiles from
ISO-8859-10, also known as latin6 using ogr2ogr on my Mac like this (learned from here):
export SHAPE_ENCODING="latin6" ogr2ogr file_utf8.shp file.shp -lco ENCODING=UTF-8
But, nothing is converted. Well, a new shapefile is created but it still has the same old encoding. I've tried with
SHAPE_ENCODING="ISO-8859-10" and still no happy result. Then I tried just a random word like SHAPE_ENCODING="blablabla" but then ogr2ogr gives me an error:
Failed to create field name 'FIELD1' : cannot convert to blablabla
So it seems like
ogr2ogr understands the latin6 encoding but then doesn't do the job for me. Maybe this is a macOS only problem?
If I do the conversion to GeoJSON with
SHAPE_ENCODING="latin6" the GeoJSON file gets recoded to UTF-8 fine:
export SHAPE_ENCODING="latin6" ogr2ogr -f GeoJSON file_utf8.geojson file.shp
Then I can convert the GeoJSON file back to Shape again:
export SHAPE_ENCODING="utf-8" ogr2ogr -f "ESRI Shapefile" file_utf8.shp file_utf8.geojson
Is there a way of converting encoding without going through the GeoJSON conversion process?