[GIS] How to fix encoding problem in shapefile importing

encodingimportpostgispostgresqlshapefile

I tried to import a shapefile to postgresql. I used PostGIS shapefile import/export manager. Earlier I have done same thing but did not face any problem. But this time I am facing problem with encoding. First I tried to import into an exsisting database with UTF-8 encoding. It showed following error:

Shapefile type: Polygon
PostGIS type: MULTIPOLYGON[2]
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.

Shapefile import failed.

So, I created another database with 'LATIN1' encoding with collation C and character type C. Then tried to set client encoding to 'LATIN1' by executing the following query.

set client_encoding='LATIN1';

Now tried to import. But still it is showing client encoding is UTF-8 and import fails. Screen shot is attached. What to do?

Screen shot of shapefile loader

Best Answer

I was facing the same problem last days, and that was due to german letters in shapefile attribute table, so for that I did the following:

Simply, just click on option button and change UTF-8 to LATIN1enter image description hereenter image description here