10

I have a shapefile with names for Regions. These don't seem to contain special characters "Ä", "Ü", "Ö", "ß" but ugly hieroglyphs.

What can I do to display them correctly. If I import the shape as UTF-8 it doesn't work.

The names are in a dbase table. So is it possible to save a dbase table in UTF-8 or is there a different way of dealing with it?

Taras
  • 32,823
  • 4
  • 66
  • 137
desputin
  • 2,301
  • 6
  • 22
  • 23

5 Answers5

19

enter image description here

try opening the dbase-file with libreoffice (or openoffice) and try different encodings, if utf-8 doesnot work try iso-8859-1 and look if the chars öäüß are displayed correctly

Kurt
  • 7,087
  • 4
  • 33
  • 51
9

In newer versions of QGIS you can right click the layer and select properties. In the first tab there is a section about layer information with the options for data source encoding. You can select UTF-8 there. Sorry for the German screen shot but since the question was about German characters...

enter image description here

Chris P
  • 1,639
  • 14
  • 26
6

Your shapefile is most probably in UTF-8, but qgis 1.8.0 has a bug in correct encoding of shapefiles. Until this is solved, you can try this workaround in Windows:

Browse to C:\Programs\Quantum GIS Lisboa\bin on Windows XP or C:\Programs (x86)\Quantum GIS Lisboa\bin on Windows 7. Look for qgis.bat and open it with a suitable editor (I have installed notepad++ for such things). After line 1, insert:

SET SHAPE_ENCODING=UTF-8

AndreJ
  • 76,698
  • 5
  • 86
  • 162
0

No I solved the problem: I opened the dbf file in LibreOffice as UTF8, put in the special characters and saved it. That was it. Very simple!

desputin
  • 2,301
  • 6
  • 22
  • 23
  • 1
    sounds like @Kurt solved your problem. Please consider marking his answer as correct to close this question. – RyanKDalton Aug 22 '12 at 23:15
  • Yes, I used the same method when facing the problems with destroyed Czech characters - used the same Libreoffice spreadsheet to produce the source CSV for my layer and after saving the layer as SHP, I saved the data from LibreOffice as UTF8 DBF table and simply replaced the DBF in tha shapefile with this one. However, the UTF8 bug is really annoying. – Juhele Feb 15 '13 at 16:51
0

Unfortunately Excel 2010 and above won't save to DBF formaat any longer so I went the route of adding "SET SHAPE_ENCODING=UTF-8" to the qgis.bat file which worked fine.

I wanted to avoid installing a whole other office suite.

Editing the batch file worked great and now with qGIS the special characters carried right through to .kml and showed up in Google Earth.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Tonyw
  • 31
  • 2