RES: [postgis-users] shp2pgsql and encoding issues

Gustavo Henrique Sberze Ribas gribas at cpqd.com.br
Tue May 24 11:12:44 PDT 2005


 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



More information about the postgis-users mailing list