[postgis-users] shp2pgsql character set conversions

Stephen Woodbridge woodbri at swoodbridge.com
Fri Mar 11 21:57:50 PST 2011

Hi All,

I am trying to load a shpfile that is in UTF8, but there is some random 
character that is not. This is causing a load error and rollback on the 

I notice looking at:

man 2 iconv_open

that it is possible to add //IGNORE and/or //TRANSLIT to the tocode string.

I haven't tried this yet, (I will), but was wondering if there is any 
reason this would not work - like maybe it does not use iconv but 
another library like libicu.

Also if this works, we should add this information to the shp2pgsql 
documentation and only help.

Actually, now that I think about this, this will not work because -E 
UTF8 would go in the fromcode and the database encoding would go into 
the tocode. So we would need a commandline argument that would support 
adding the //IGNORE



More information about the postgis-users mailing list