[gdal-dev] How to debug the shape open option "encoding"?

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Fri May 11 10:50:21 PDT 2018


Hi,

I will send a download link for you. I made conversion into GeoPackage which requires UTF8 encoding. In the following list OK means no warnings and correctly UTF encoded characters (åäöÅÄÖ) saved into gpkg database. In the "not a valid UTF-8" case I get warnings and non-ASCII characters are also written in a wrong way into GeoPackage.

OSGeo4W
.dbf with LDID "87 / 0x57" flag
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp
Result: OK
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp -oo encoding="ISO_8859-1"
Result: OK

.dbf without LDID "87 / 0x57" flag
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp
Result: "not a valid UTF-8 string" warnings
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp -oo encoding="ISO_8859-1"
Result: OK

Gisinternals build
.dbf with LDID "87 / 0x57" flag
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp
Result: OK
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp -oo encoding="ISO_8859-1"
Result: "not a valid UTF-8 string" warnings

.dbf without LDID "87 / 0x57" flag
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp
Result: "not a valid UTF-8 string" warnings
ogr2ogr -f gpkg test.gpkg dr_linkki_k.shp -oo encoding="ISO_8859-1"
Result: "not a valid UTF-8 string" warnings

-Jukka-
Lähettäjä: Even Rouault [mailto:even.rouault at spatialys.com]
Lähetetty: 11. toukokuuta 2018 19:41
Vastaanottaja: gdal-dev at lists.osgeo.org
Kopio: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Aihe: Re: [gdal-dev] How to debug the shape open option "encoding"?


Jukka,



AFAIR there shouldn't be significant differences of behaviour in the shapefile driver between 2.2.4 and 2.3.0 . Can you share the problematic shapefile ?

>

> Is there anything else that an end user could do for finding out why the

> gisinternals build fails with recoding?



Probably not



> BTW is it documented somewhere

> which are the correct values for different encodings? For example in my

> case I had to use exactly "-oo encoding="ISO_8859-1".



This is the values supported by iconv. Might depend on iconv is compiled I guess.

But I'm a bit confused by your report. Did "-oo encoding="ISO_8859-1" worked despite the warnings ?



Even



--

Spatialys - Geospatial professional services

http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180511/77348291/attachment.html>


More information about the gdal-dev mailing list