I have a shapefile with names for Regions. These don't seem to contain special characters but ugly hieroglyphs. What can I do do display them correctly. If I import the shape as UTF-8 it doesn't work...

Also the Names are in a dbase table. So is it possible to save a dbase table in utf8 or is there a different way of dealing with it?

up vote 16 down vote accepted

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

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

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

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!

  • sounds like @Kurt solved your problem. Please consider marking his answer as correct to close this question. – RyanDalton 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

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.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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