Jukka, There's no ogr2ogr switch to control character encoding.
you didn't mention with which tool you tried to open the shapefiles. I suppose it's not with OGR itself, as the shapefile driver does not do anything with the encoding of the data it reads or writes. The issue is that it currently writes DBF with LDID/87 (= 0x57, ANSI) whatever the encoding of the data is really (so if UTF-8 data goes into this DBF and a software tries to interpret it according to the LDID, it will read corrupted characters). There was interest expressed on this mailing list the last few days for improved encoding support (see http://lists.osgeo.org/pipermail/gdal-dev/2010-May/024663.html) This was also discussed here : http://trac.osgeo.org/gdal/ticket/3403 I can see different possibilities : * use UTF-8 as pivot and transcode into/from it when reading/writing DBF. Which would be consistant with http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode. A creation option would be necessary to specify the target CPG/LDID. * less ambitious : just use a creation option to specify the CPG/LDID of the actual data passed without doing any transcoding. The difference between the 2 options is conceptually a bit like -t_srs and -a_srs Le Monday 24 May 2010 14:16:07 Jukka Rahkonen, vous avez écrit : > Even Rouault <even.rouault <at> mines-paris.org> writes: > > Jukka, > > > > In http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_gml_geom.py > > , you can have an overview of a few GML 3 supported geometries. > > > > The best is that you try and report what doesn't work so that it gets > > possibly improved. > > Hi, > > I had a try with some feature types coming from Geoserver WFS 1.1.0. > Ogr2ogr converts GML33 points, linestrings and multisurfaces (containing > ->Polygons-> LinearRings) into shapefiles without problems. > > Our WFS is using UTF-8 encoding. When I open the shapefiles which I created > with ogr2ogr all non-ASCII characters in my attributes look pretty odd. I > can't find any switch in ogr2ogr for controlling character encoding. Is is > somewhere hidden? > > -Jukka Rahkonen- > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
