1

Connecting: host=localhost port=5432 user=postgres dbname=tremblement_de_terre Connection succeeded. Connecting: host=localhost port=5432 user=postgres dbname=tremblement_de_terre

============================== Importing with configuration: m_cap point, public, geom, /home/jean/Documents/M_CAP Point.shp, mode=c, dump=1, simple=1, geography=0, index=1, shape=1, srid=0 Shapefile type: MultiPoint PostGIS type: POINT[2] Unable to convert data value to UTF-8 (iconv reports "Chaîne multi-octets ou étendue de caractères invalide ou incomplète"). 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.

After trying to know the encode setting with the ubuntu shell command file -f .shp,the result is something like

file -f M_CAP\ Point.shp : ERROR: cannot open ' (No such file or directory) : ERROR: cannot open' (No such file or directory) : ERROR: cannot open ' (No such file or directory) ��OA�\���?A�: ERROR: cannot open��OA�\���?A�' (No such file or directory) ��OA: ERROR: cannot open ��OA' (No such file or directory) ��OA: ERROR: cannot open��OA' (No such file or directory) �5A�X=�: ERROR: cannot open �5A�X=�' (No such file or directory) �5A�X=�: ERROR: cannot open�5A�X=�' (No such file or directory) �5A�X=�: ERROR: cannot open �5A�X=�' (No such file or directory) ��XCAp���_A~�: ERROR: cannot open��XCAp���_A~�' (No such file or directory)


When I also try to open this file with QGis as a Vector layer, using UTF-8 encoding, It opens clearly. What happens now when trying to import it to postgres using shp2pgsql-gui?

Please help me, the original file have been created on windows, and I am using Ubuntu 12.04 Lts. Thanks a lot

  • The Question need more details to make it answerable. Please provide details on what you are trying to do and what you have tried so far to debug the problem. You can have a look at this question on tips to improve the question meta.gis.stackexchange.com/questions/3349/… – Devdatta Tengshe Jan 7 '14 at 11:44
  • Can you supply sample data via dropbox or similar? – AndreJ Jan 7 '14 at 12:11
  • thank you, for your help i had the same probleme ..you are write. – sihem Mar 8 '17 at 8:00
1

When importing the shapefile by means of the gui interface press in "Options" and in "DBF file character encoding" set "LATIN1" as suggested by the error message.

If your dbf is in another encoding that LATIN1, set the correct one instead of this. If you are on windows probably it would be "CP1250"

  • Thanks, I just have changed the character encoding to "Latin1" as you said, and it works perfectly! Thanks a lot. – dadson Jan 7 '14 at 14:11

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.