Hi, There is some text about client encoding in https://gdal.org/drivers/vector/pg.html
" By default it is assumed that text being sent to Postgres is in the UTF-8 encoding. This is fine for plain ASCII, but can result in errors for extended characters (ASCII 155+, LATIN1, etc). While OGR provides no direct control over this, you can set the PGCLIENTENCODING environment variable to indicate the format being provided. For instance, if your text is LATIN1 you could set the environment variable to LATIN1 before using OGR and input would be assumed to be LATIN1 instead of UTF-8. An alternate way of setting the client encoding is to issue the following SQL command with ExecuteSQL() : "SET client_encoding TO encoding_name" where encoding_name is LATIN1, etc. Errors can be caught by enclosing this command with a CPLPushErrorHandler()/CPLPopErrorHandler() pair." I would try with that environmental variable first. -Jukka Rahkonen- -----Alkuperäinen viesti----- Lähettäjä: gdal-dev <gdal-dev-boun...@lists.osgeo.org> Puolesta matteo Lähetetty: maanantai 29. marraskuuta 2021 18.52 Vastaanottaja: gdal-dev@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@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev