[postgis-users] Shp2pgsql : unable to convert french UTF8 encoded shapefiles

Alexandre Gacon alexandre.gacon at masagroup.net
Mon Feb 4 01:29:17 PST 2008


Hi,

I am trying to load several shapefiles provided by TéléAtlas in a postgis
database with shp2pgsql on Windows XP and I have several problems.

The shapefiles contains the data for France and are encoded in UTF8.

If I generates pgsql files without indicating the encoding to use, shp2pgsql
works fine but I can't execute the file with psql : I got an error about an
"Illegal byte sequence". If I open a pgsql file with the pgAdmin tool, I
manage to execute the sql request and it works fine. This solution helps me
but it is not enough : I can't do this for large shapefiles (the pgAdmin
tool can not open the file) and I have several hundreds of files to load.

If I try to generate the pgsql file with the -W "UTF8" option, I got the
same error than the psql command : "utf8 : Illegal byte sequence".

Can somebody help me ?

Alexandre Gacon




More information about the postgis-users mailing list