[postgis-users] Modify encoding of shapefile

Nicolas Ribot nicky666 at gmail.com
Tue May 29 03:22:40 PDT 2007

> Hi list !
> I had to export a bunch of data from postgis to shapefile (using pgsql2shp), but unfortunately I did this without changing my client-encoding.
> The destination application does not like the shapefiles the way they are, and all special characters are unreadable ("Ã(c)" instead of "é" for instance).
> The export was quite painfull (a lot of time and some manual work), and I was wondering whether there would be a simple way to import the shapefiles into postgis, and then re-export them with the correct encoding (LATIN1, AFAICT) ?
> Thanks for any hint on this !

Iconv may help, I think, converting shapefile encoding into target db encoding:

shp2pgsql -dDI TRONCON_ROUTE.SHP troncon_route | iconv -f LATIN1 -t
UTF-8 | psql routing

as seen on David techer's pgRouting tutorial


More information about the postgis-users mailing list