[MAPSERVER-USERS] ASCII -> UTF-8 convert problems for importing (GIS) data

rich.fromm nospam420 at yahoo.com
Mon Apr 21 19:25:06 EDT 2008



Emilio Ponce wrote:
> 
> I had the same problem, to convert Charset you can use this option of
> the Shp2pgsql tool
> 
> shp2pgsql shapefile_name table_name | iconv -f LATIN1 -t UTF-8 | psql -d
> db_name
> 
> It converts the charset of the shapefile from LATIN1 to UTF-8
> 

I think you're doing an unneccessary step here.  Assuming LATIN1 is a valid
alias for ISO-8859-1 as recognized by shp2pgsql, just use shp2pgsql -W
LATIN1 to do the conversion to UTF-8.  (Or if that doesn't work, use -W
ISO-8859-1.)

But my main point is that you can have shp2pgsql do the conversion, and
there's no need to pipe it to iconv.

- Rich

-- 
View this message in context: http://www.nabble.com/ASCII--%3E-UTF-8-convert-problems-for-importing-%28GIS%29-data-tp16768968p16817682.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list