7

In QGIS, I can't read characters of the shapefile in my geological layer attribute table : I don't understand or there are misunderstandable characters of shapefile.

Below a screenshot of the attribute table.. Does anyone know how I could get the original values back ?

screenshot of table of attributes of the geological map

5
  • 2
    Please choose one software package, then research support for UTF-8 strings and international character support, then edit this question to specify what you have attempted.
    – Vince
    Commented Sep 13, 2017 at 13:17
  • 1
    Create a .cpg file using a text editor with the same name of the layer(e.g. geological_map.cpg), and insert the Unicode encoding identifier `UTF-8' into it.
    – Amit Ghosh
    Commented Sep 13, 2017 at 18:50
  • I think it is quite easy the aswer for this question, I do not agree with having it on hold. The answer for a QGIS user is just going to Layer Properties->General->Data source encoding and look for the right encoding, many times UTF-8 fix it
    – Marco
    Commented Sep 14, 2017 at 12:09
  • @AmitGhosh (or Marco) You should post your comments as answers now the subject has been reopened
    – gisnside
    Commented Sep 14, 2017 at 16:32
  • Please open the .cpg file with a text editor and tell us what is inside.
    – inc42
    Commented Mar 16, 2020 at 6:51

2 Answers 2

8

As @Marco mentioned in the comment, look for the right encoding by changing the data source encoding from the layer properties window. The most probable choice is UTF-8

enter image description here

Most of the modern GIS softwares (including QGIS and ArcGIS) store the encoding information in an optional .cpg (code page)file. Therefore, you should create the same manually with proper encoding identifier (as mentioned in the comment) To create a .cpg file automatically in QGIS save (right click on the layer>save as) the layer and select the proper encoding. Then QGIS/ArcGIS will detect the proper encoding.

enter image description here

2
  • 1
    What if UTF-8 doesn't work as the encoding? I have a file that I have tried multiple different encodings and none of them convert the accents into the characters I would expect. How can I find the correct one?
    – kl-higgins
    Commented May 24, 2018 at 18:11
  • I've same problem but in QGIS 3.4 in Linux (LMDE 3) Debian 9, Do you know how can I fix that I checked my ESRI Shapefiles layers are in UTF-8 by default
    – Navid
    Commented Apr 5, 2019 at 9:20
1

I also encountered this problem and fixed it. After following Amit's suggestion, you may also need to click on the "Menu -> Settings -> Options -> Data Sources", where you can uncheck "Ignore shapefile encoding declaration". Then, restart your project. This worked for me.

setting menu

Your Answer

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

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