[gdal-dev] ogr2ogr encoding

Nico Mandery nico.mandery at geops.de
Fri May 29 05:57:39 EDT 2009


Hi,

I had a similar problem with german umlauts not to long ago. I solved it
by specifing the client encodung in the postgresql connection string

example:
ogr2ogr -f PostgreSQL PG:"dbname=mydb options='-c
client_encoding=latin1'" .....

hope it helps,
nico


Alexandre Dube schrieb:
> Hi,
> 
>  I need to add a dbf file to a postgis database.  I use ogr2ogr with the
> postgresql driver for that.  Problem is, I get an encoding error :
> 
> === ERROR START ===
> Warning 1: PQescapeString(): incomplete multibyte character
> 
>  input: 'Río'
>    got: 'Río '
> 
> ERROR 1: INSERT command for new feature failed.
> ERROR:  invalid byte sequence for encoding "UTF8": 0xed6f20
> HINT:  This error can also happen if the byte sequence does not match
> the encoding expected by the server, which is controlled by
> "client_encoding".
> === ERROR END ===
> 
>  I tried to set the database encoding of my database with \encoding or
> SET CLIENT_ENCODING TO 'encoding'; but it's not working.  I tried latin1
> and UTF8.  What am I missing ?
> 


More information about the gdal-dev mailing list