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

2021-12-07 Thread matteo
Hi Even, this is also a solution. If I get it correctly I can get the encoding from within QGIS and pass it to the Processing script that calls GDAL. In this way the encoding is taken upstream and ogr2ogr should be able to pass it to the PG database Thanks! Matteo

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

2021-12-03 Thread Even Rouault
Instead of turning Postgres client_encoding to LATIN1 (which won't work here because -f PostgreSQL goes through the CreateDataSource() OGR API, which will ignore destination dataset open options provided with -doo) , I would rather set the shapefile encoding with -oo ENCODING=ISO-8859-1,then

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

2021-12-03 Thread matteo
Hi Rahkonen, sorry for the delay. The command, built with Processing in QGIS using the GdalUtils utility is at the end: ogr2ogr -f PostgreSQL "PG:dbname='db' host=myhost port=myport user='myuser' password='mypassword' sslmode=disable schemas=myschema" shapefile.shp --config PG_USE_COPY YES

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

2021-11-30 Thread Rahkonen Jukka (MML)
- Lähettäjä: matteo Lähetetty: tiistai 30. marraskuuta 2021 13.05 Vastaanottaja: Even Rouault ; Rahkonen Jukka (MML) ; gdal-dev@lists.osgeo.org Aihe: Re: [gdal-dev] PGCLIENTENCODING in ogr2ogr (and QGIS) Hi Rahkonen and Even, thanks for the answers. If I add -oo PRELUDE_STATEMENTS=&quo

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

2021-11-30 Thread matteo
Hi Rahkonen and Even, thanks for the answers. If I add -oo PRELUDE_STATEMENTS="SET client_encoding TO LATIN1" the I get this error: Warning 6: driver ESRI Shapefile does not support open option PRELUDE_STATEMENTS and I think it that makes sense because I want to put in a UTF8 DB some

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

2021-11-29 Thread Even Rouault
-Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: gdal-dev 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 utili

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

2021-11-29 Thread Rahkonen Jukka (MML)
." I would try with that environmental variable first. -Jukka Rahkonen- -Alkuperäinen viesti- Lähettäjä: gdal-dev 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

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

2021-11-29 Thread matteo
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