Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 5F2E5B5DC1E for ; Mon, 12 Sep 2011 09:04:08 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 61335-01 for ; Mon, 12 Sep 2011 12:04:01 +0000 (UTC) X-Greylist: delayed 00:08:45.837376 by SQLgrey-1.7.6 Received: from zebrastreifen.25th-floor.com (zimbra.kmu-mail.at [78.142.162.221]) by mail.postgresql.org (Postfix) with ESMTP id 3D714B5DC1A for ; Mon, 12 Sep 2011 09:04:00 -0300 (ADT) Received: from lerchenferse.local (unknown [192.168.100.4]) by zebrastreifen.25th-floor.com (Postfix) with ESMTPSA id 05DBF113BCFD; Mon, 12 Sep 2011 13:55:13 +0200 (CEST) Message-ID: <4E6DF320.9040908@25th-floor.com> Date: Mon, 12 Sep 2011 13:55:12 +0200 From: Florian Helmberger User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 MIME-Version: 1.0 To: pgsql-admin@postgresql.org CC: mandana.mokhtary@wspgroup.se Subject: Re: Encoding Problem References: <6C75D80E19AC6A4FBEB7C7EAE9D654330218A7C3@EXC02COL1SE.se.wspgroup.com> In-Reply-To: <6C75D80E19AC6A4FBEB7C7EAE9D654330218A7C3@EXC02COL1SE.se.wspgroup.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/63 X-Sequence-Number: 38300 On 12.09.11 13:38, Mokhtary, Mandana wrote: > I am trying to load shapfiles into the postgreSQL9.0. The database > encoding is UTF8. > > My shapfiles coming from Sweden, so there are some Swedish alphabet in > the fields name and also inside columns data. > > I used this command to load shapfiles: > > C:\Pragram Files\PostgreSQL\9.0> shp2pgsql -s 2400 –c –W LATIN1 > C:/project/Mandana/OBO/WSPbackground_shp/Primärkartan.shp |psql –U > postgres OBO > > I could insert shapfiles which do not have Swedish alphabet in their > fields name or data inside the columns, but I could not load others that > have Swedish alphabet. > > I get this ERROR: > > *invalid byte sequence for encoding “UTF8”:0xe4726b* > > Any help would be so appreciated. Hi! You might need to set the CLIENT_ENCODING to latin1. http://www.postgresql.org/docs/9.0/static/multibyte.html Regards, Florian -- Florian Helmberger -------------------- 25th-floor - Operating Custom Solutions de Pretis & Helmberger KG Seidengasse 33-35/Top 19 1070 Wien, Austria Mail: fh@25th-floor.com Web : http://www.25th-floor.com Tel.: +43 1 / 512 82 89 - 60 Fax : +43 1 / 512 82 89 - 76 Mob.: +43 699 / 109 24 24 5 ---------------------------------------