[postgis-users] Tools to change the encoding of the SHP/DBF files (from Latin1 to UTF-8)

Mac Wind macwind2 at gmail.com
Thu May 10 14:39:28 PDT 2012


Hi Sandro. Thank you very much for your answer.

With that parameter (-W), am I changing the encoding of the DB or I am
merely indicating the encoding of the source?

Regards.

On Tue, May 8, 2012 at 3:13 PM, Sandro Santilli <strk at keybit.net> wrote:

> On Tue, May 08, 2012 at 02:56:28PM +0200, Mac Wind wrote:
> > Hi.
> >
> > Using PostGIS 1.5 on Windows, I get this error message when trying to
> > import a SHP:
> > ----------------
> > Unable to convert data value to UTF-8 (iconv reports "Invalid argument").
> > Current encoding is "UTF-8". Try "LATIN1" (Western European), or one of
> the
> > values described at
> > http://www.postgresql.org/docs/current/static/multibyte.html.
> > ----------------
> >
> > Really my data are in Latin1 encoding, but I don't want to change the
> > encoding of the DataBase into Latin1, but change the encoding of the SHP
> > (in fact, of the DBF) into UTF-8.
> >
> > Which tool could I use to do this? Thank you very much.
>
> You don't have to change DB encoding, just tell the loader that your
> data is in Latin1:
>
>  $ shp2pgsql -W Latin1 ...
>
> --strk;
>
>  ,------o-.
>  |   __/  |    Delivering high quality PostGIS 2.0 !
>  |  / 2.0 |    http://strk.keybit.net - http://vizzuality.com
>  `-o------'
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120510/a99c98d3/attachment.html>


More information about the postgis-users mailing list