[gdal-dev] ogr2ogr encoding

Alexandre Dube adube at mapgears.com
Thu May 28 08:34:44 EDT 2009


Hi Frank,

Frank Warmerdam wrote:
>
> Alexandre,
>
> The OGR Postgres driver help says:
>
> """
> 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. <p>
> """
>
> Could you try setting the PGCLIENTENCODING environment variable to LATIN1
> before running ogr2ogr?
>
> Best regards,

I tried to set PGCLIENTENCODING to LATIN1 but I got the same error.  My 
terminal is also set to latin1 and when I get the error I can see the 
character correctly.  Changing it to utf8, I see a <?> character 
instead, so I assume the dbf is in latin1.

Is there a way I could be sure of the dbf encoding ?  It's a file from 
the tiger data set, maybe someone already know that ?  I checked in the 
tiger doc but didn't find anything.

Thanks,

-- 
Alexandre Dubé
Mapgears
www.mapgears.com



More information about the gdal-dev mailing list