[postgis-users] problem with pgsql2shp and special characters/umlaute

Steffen Macke sdteffen at gmail.com
Tue Jul 4 07:58:23 PDT 2006


Hello Kathrin,

> Savièse = Savièse
> Unterbäch = Unterbäch
> Grône = Grône
> Bürchen = Bürchen

> I use PostgeSQL 8.1.3 with POSTGIS 1.0.4 and GEOS 2.1.4.
> The encoding of the database is SQL-ASCII.

>
> Is it the right encoding of database?

Maybe not.
If you look at the ASCII table:

http://en.wikipedia.org/wiki/ASCII

There are no "Umlaute" or accents.

You may want to try ISO 8859-1 (aka LATIN1 in PostgreSQL).

I created a database with LATIN1 encoding, wrote some äs to it,
dumped a DBF using pgsql2shp and was able to see them using OpenOffice.

On the PostgreSQL level, you could simply use UTF-8 to store
all characters without problems, however
most Shapefile-reading software packages that I know don't like
UTF-8 in shapefiles.

I usually use UTF-8 on the database and then use the
PGCLIENTENCODING environment variable to create shapefiles
in the proper encoding.

Make sure that the software you use to look at the DBFs is using
the right encoding (OpenOffice asks you for the encoding to use
when opening DBFs).

Regards,

Steffen



More information about the postgis-users mailing list