RES: [postgis-users] shp2pgsql and encoding issues
Mike Leahy
mgleahy at fes.uwaterloo.ca
Tue May 24 11:33:01 PDT 2005
Gustavo,
That works so much better. Thanks for correcting me...I wish I had known this over a year ago, because even with my approach to the problem sometimes some characters were not converted properly (which I forgot to mention), even though they were 'allowed' as SQL_ACII.
Mike
Gustavo Henrique Sberze Ribas wrote:
> Tom,
>
> try setting the client encoding to LATIN1, put
>"SET client_encoding = 'LATIN1';" on the first line of
>the file created with shp2pgsql.
>
> As for SQL_ASCII, I advise against it. SQL_ASCII is for 7-bit
>text data only, if you need to store text in French,Italian,
>Portuguese,Spanish,... use LATIN1 instead (or UNICODE).
>
> With SQL_ASCII there is no restriction on what data can be entered
>and you can get yourself in a real mess with different clients entering
>data in different encodings.
>
>
>--
>Gustavo
>
>
>
>>I had the same problem a while ago, and found that if my
>>database is set
>>to SQL_ASCII it would work fine...though I think you can only set the
>>encoding when the database is created. I tried using some
>>text editors
>>to convert the characters in the script created by the shp2pgsql tool,
>>but that didn't work. I was able to use find/replace to
>>change special
>>characters (in Spanish) to unicode-compatible characters,
>>which sort-of
>>worked, but I didn't really want to get rid of those characters. I
>>found it was just easier to create my database in SQL_ASCII from the
>>start. Perhaps somebody else has a more effective solution...
>>
>>Mike
>>
>>
>_______________________________________________
>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/20050524/c8f44343/attachment.html>
More information about the postgis-users
mailing list