[postgis-users] pgsql2shp encoding problem

Ben Madin lists at remoteinformation.com.au
Wed Jul 4 22:39:16 PDT 2012


G'day all,

I'm having a problem exporting data from a utf8 database to shape files for a client. They are receiving the data and viewing it only to find that characters with diacritics are all messed up.

My understanding was that .dbf was originally ascii only (and the column headings still are) but now the .dbf file can contain data in any encoding. 

So with the suggestion of nicolas ribot, I am exporting using :

export PGCLIENTENCODING=LATIN9; pgsql2shp -f  etc etc

I also read in a number of sites that this can be specified by adding a file with a .cpg suffix, and including the name of the encoding for the .dbf in it, i.e. LATIN9

Presumably, one would end up with :

data.cpg
data.dbf
data.prj
data.qix
data.shp
data.shx

Can anyone advise me if this is true and reasonable? Or more importantly, will work with ArcGIS and / or MapServer?

cheers

Ben




More information about the postgis-users mailing list