I'm trying to import ArcGIS shapefile to PostGIS. I get an error like this:


My client and server encoding both of them "UTF-8"

enter image description here

enter image description here

I get an error especially in the point type.

How can I fix it?

enter image description here

I tried Latin1 and Latin3 but did not work.

enter image description here

  • do you have qgis? you should try and import this file through there too see what happens – ziggy Apr 10 '17 at 19:41

I think your issue is that your shapefile's DBF character encoding is not UTF-8. By default shp2pgsql-gui assumes the incoming encoding is UTF-8 so if there is a mismatch here the tool will fail.

You need to ensure that the DBF file character encoding (accessed through the Options menu of shp2pgsql-gui) matches that of your shapefile.

enter image description here

If you don't know what the DBF encoding is and UTF-8 hasn't worked, it's worth trying LATIN-1.

| improve this answer | |
  • Hey Ali, thank you for your answer. I tried LATIN1 and LATIN3 but I'm getting the same error. – Umut Apr 10 '17 at 19:36
  • 1
    @Umut Okay, could be Windows-1252 – Ali Apr 10 '17 at 19:46
  • 1
    @Umut Also, you can avoid the guesswork if you have a .cpg file along with the standard shapefile components as this will give you information about the character encoding. – Ali Apr 10 '17 at 19:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.