[gdal-dev] ogr2ogr GML creation encoding issue

Even Rouault even.rouault at mines-paris.org
Fri Feb 24 14:05:00 EST 2012


CC'ing the list in case someone has a better idea. I don't. Should work...

Le vendredi 24 février 2012 19:59:32, Travis Kirstine a écrit :
> No luck with setting the client encoding variables.  The strange thing
> is that the strings appear fine in pgAdmin and qgis but not in the
> terminal or ogr output.
> 
> # env
> ...
> LANG=en_US.UTF-8
> PGCLIENTENCODING=UTF8
> ...
> 
> # psql -c 'SHOW client_encoding'
>  client_encoding
> -----------------
>  UTF8
> 
> On 24 February 2012 11:56, Even Rouault <even.rouault at mines-paris.org> 
wrote:
> > Selon Travis Kirstine <traviskirstine at gmail.com>:
> >> I have a PostGIS / PostgreSQL database (UTF8) containing OSM data that
> >> was imported using osm2pgsql.  I have been extracting GML subsets of
> >> the data using ogr2ogr.  I am having issues with the encoding of the
> >> resultant GML files, the attribute strings have invalid UTF8
> >> characters.
> > 
> > This sounds more as an issue with your PostGIS database then. You should
> > make sure that your PGCLIENTENCODING (or equivalent mechanism) is set to
> > UTF-8. The GML driver will just copy what it receives from the PostGIS
> > DB.
> > 
> >> My Command
> >> ogr2ogr -f GML -t_srs EPSG:4326 -s_srs EPSG:900913 -nln administrative
> >> planet_osm_polygon_boundary_administrative.gml PG:'dbname=osmdb
> >> user=osm' -sql "SELECT admin_level, name, way FROM planet_osm_polygon
> >> WHERE boundary = 'administrative')"
> >> 
> >> Regards
> >> _______________________________________________
> >> gdal-dev mailing list
> >> gdal-dev at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list