[gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)

Even Rouault even.rouault at spatialys.com
Mon Nov 29 12:33:56 PST 2021


Hi,
> I would try with that environmental variable first.

The thing is that there's no way in the vector format conversion tool of 
QGIS to specify pure environment variables (GDAL configuration options 
can be passed with --config key value, but PGCLIENTENCODING can't be 
specify that way). However it is possible to use the PRELUDE_STATEMENTS 
open option of the PostgreSQL driver, by adding (a bit abusively) in the 
additional creation option entry box:   -oo PRELUDE_STATEMENTS="SET 
client_encoding TO LATIN1"  (assuming that the need is to convert from 
PostgreSQL. )

Even

>
> -Jukka Rahkonen-
>
> -----Alkuperäinen viesti-----
> Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta matteo
> Lähetetty: maanantai 29. marraskuuta 2021 18.52
> Vastaanottaja: gdal-dev at lists.osgeo.org
> Aihe: [gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS)
>
> Hi all,
>
> I'm trying to run a command with the GdalUtils.runGdal utility of QGIS but I get some troubles because of the encoding.
>
> Basically I need to set the encoding to PGCLIENTENCODING=LATIN1. If I call it in a console, no problem at all (of course :) ). Wondering if I can set the encoding also within QGIS (that is basically via the ogr2ogr command).
>
> I know that this is a more QGIS question, but QGIS is calling ogr2ogr, so I think if there is a ogr2ogr way to do that then also within QGIS should be possible.
>
> Cheers and thanks for any ideas!
>
> Matteo
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list