1

I am having difficulties when I try to load a shapefile into my database, the is because I do not know the encoding of the dbf portion of the shapefile. The attribute tables are in Spanish, I have tried UTF8 and LATIN1/ISO-8859-1.

How can I check the encoding of the dbf file? I do not want to waste anymore time trying all the encodings.

The database is Postgres 9.4.4 with Postgis 2.2.1, I use Qgis 2.10.1 to visualize the data before loading it to the database.

Looks like the files were made in a mac, not sure though.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Progs
  • 259
  • 2
  • 8
  • 2
    dBase predated ISO encoding by many, many moons, so this is exclusively an application-specific issue. Please edit the question to specify what GIS software you are using. You should also specify the database software in use, since some of them predate encoding schemes as well. – Vince Jan 14 '16 at 18:05
  • Can you share the error message? – klewis Jan 14 '16 at 18:41
  • @klewis there is no error message, the letters with accents just appear with question mark – Progs Jan 14 '16 at 18:48
  • 4
    see this post http://gis.stackexchange.com/questions/3529/which-character-encoding-is-used-by-the-dbf-file-in-shapefiles, it would seem latin should work if you are using latin characters, http://www.fileformat.info/info/charset/UTF-8/list.htm – If you do not know- just GIS Jan 14 '16 at 18:49
  • 1
    Have you tried with 'windows-1252'. I've come across some shapefiles with such encoding. – Germán Carrillo Jan 14 '16 at 20:29
  • @gcarrillo no, still the same :/ – Progs Jan 14 '16 at 21:25
  • 1
    Have you use 'System'? :D – Germán Carrillo Jan 14 '16 at 21:43
  • 1
    From your post it's not clear when exactly you see the question marks - with the shape in QGIS (as label or attribute table?) or in the database (pgadmin, command line, again QGIS?). Have you tried fixing the encoding with https://plugins.qgis.org/plugins/shapefile_encoding_fixer/ ? Have you tried this: http://gis.stackexchange.com/a/31889/8673 ? Also take a look at the comments of this answer, maybe creating on mac was some issue http://gis.stackexchange.com/a/15914/8673 – bennos Jan 15 '16 at 13:51
  • @bennos the encoding fixer did it – Progs Jan 15 '16 at 15:36

1 Answers1

1

When having enconding issues with a Shapefile you can try the QGIS Plugin Shapefile Encoding Fixer.

Other helpful questions are:

bennos
  • 2,069
  • 1
  • 15
  • 29