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

asked Jan 7, 2014 at 11:04
3
  • 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/… Commented Jan 7, 2014 at 11:44
  • Can you supply sample data via dropbox or similar? Commented Jan 7, 2014 at 12:11
  • thank you, for your help i had the same probleme ..you are write. Commented Mar 8, 2017 at 8:00

1 Answer 1

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"

answered Jan 7, 2014 at 12:11
1
  • Thanks, I just have changed the character encoding to "Latin1" as you said, and it works perfectly! Thanks a lot. Commented Jan 7, 2014 at 14:11

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.