[postgis-users] pgsql2shp encoding problem

Sandro Santilli strk at keybit.net
Thu Jul 5 02:07:59 PDT 2012


On Thu, Jul 05, 2012 at 01:39:16PM +0800, Ben Madin wrote:
> 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.

Does their system support utf8 ?

> 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?

You tell us what works with what by testing it.
My impression is that the standard should be UTF8 for everything, specifically
to avoid the localization issue once and for all.

--strk; 

  ,------o-. 
  |   __/  |    Delivering high quality PostGIS 2.1
  |  / 2.1 |    http://strk.keybit.net - http://vizzuality.com
  `-o------'




More information about the postgis-users mailing list