I'd like to ask whether there is a way to read greek fonts in a shapefile's attribute table within QGIS 1.8.0.

  • You can find a sample greek shapefile here: geodata.gov.gr/geodata/… at the SHP button
    – AndreJ
    Commented Dec 16, 2012 at 6:27
  • ... and the GML from the linkbutton next to it works in QGIS without any complaints. AAARGH!!!!
    – AndreJ
    Commented Dec 17, 2012 at 8:17
  • 1
    I'd like to tahnk everyone for their help. I tried most of the solutions provided, expect for the .cpg one which I'll try in my laptop, some of them worked. For INSPIRE datasets, like the ones used from the geodata.gov.gr portal, it works when you select either UTF8 or ISO-8859-7 when opening the shapefile in QGIS. The problem lies with shapefiles produced without specifying the relevant encoding. Nevertheless it seems I can use most of my dataset, maybe it'll be easier in the next QGIS version.
    – ZISIS
    Commented Dec 18, 2012 at 16:52
  • Please do give the .cpg method a try, since it essentially declares the shapefile's encoding - useful if the shapefile was produced without specifying a correct encoding.
    – anoved
    Commented Dec 21, 2012 at 16:12

3 Answers 3


You might try creating a file with the same base name as the shapefile but with a .cpg extension, containing a single line of text identifying the encoding, be it UTF-8 or something else. I am not sure if this will resolve the problem with QGIS, but I have had some success with this method to force multi-byte characters in attribute data to be interpreted correctly (typically in situations where attribute data was written in an encoding incompatible with the code page given in the DBF file header's LDID field).

See http://support.esri.com/en/knowledgebase/techarticles/detail/21106 for more info on .cpg files.

Update 1: Just to illustrate that QGIS does respond to the presence of .cpg files, here is an attribute table screenshot of two identical test shapefiles. The only difference is that attrb has an attrb.cpg file declaring UTF-8. In this case, the Unicode test characters are rendered correctly.

Unicode attribute values, with and without UTF-8 .cpg file

Both shapefiles have 87 as the value of the Language Driver ID (LDID) byte in the DBF header, indicating ISO-8859-1 encoding. Thus, at least in this case, providing a .cpg allows the user to override the internally-declared encoding without actually modifying or re-saving the DBF file.

I do not have a shapefile containing Greek characters to test, but you might try declaring 8859-7 (ISO) or 1253 (ANSI) in place of UTF-8 in the .cpg file.

Update 2: I downloaded a sample shapefile from the page Andre suggested (thanks!). As you can see, by default the fields containing Greek text do appeared garbled:

Greek shapefile with default encoding

I then created a file named nomoi_okxe.cpg in the same directory as the shapefile, containing the text 1253 (the Windows code page number for Greek). I then reopened the shapefile in QGIS:

Greek shapefile with Greek code page specified

That looks Greek to me!

ZISIS, is this sample shapefile representative of the files you need to work with?

Update 3: The examples above were based on QGIS 1.8.0 on Mac OS X 10.8.2. I have also tested this method with QGIS 1.7.5 on Linux Mint 14:

Screenshot of sample Greek shapefile with cpg file open in qgis on linux

  • Unfortunately QGIS does not react on any .cpg file.
    – AndreJ
    Commented Dec 15, 2012 at 12:16
  • 1
    On the contrary, QGIS 1.8 does recognize .cpg files (I've edited my answer with an example) - but since I don't have a Greek shapefile to test, I concede that it may not be any help in ZISIS' case.
    – anoved
    Commented Dec 15, 2012 at 16:08
  • 1
    You can find a sample greek shapefile here: geodata.gov.gr/geodata/… at the SHP button. I did not suceed with the cpg file...
    – AndreJ
    Commented Dec 15, 2012 at 20:06
  • 1
    Yes I can confirm the correct encoding of the Greek names. They appear correctly
    – nickves
    Commented Dec 16, 2012 at 3:42
  • 1
    @anoved: Thanks a lot! This works with Vietnamese on Ubuntu 12.04, Qgis 1.8.0. Commented Mar 8, 2013 at 8:41

SOLUTION A for utf-8 encoded shapefiles

Supposed you are working on Windows, look for qgis.bat in bin directory, and open it with a text editor. after the first line, insert


and save. Qgis 1.8.0 has some problems with encoding, using your computers default font instead of the one you specify. It is fixed in Qgis Master (1.9.0) by now, which you can install with osgeo4w setup.

SOLUTION B for ISO-8859-7 encoded shapefiles

We had a similar issue lately on the mailing list:


It works on the cited shapefile only with Qgis Master (1.9.0):

In Settings -> Options -> General, there is a checkbox

[ ] Ignore shapefile encoding

Uncheck it.

Then open the shapefile in QGIS with ISO-8859-7.

With this option shapefile encoding is done the same way as in Qgis 1.7.4, that is leaving it to QGIS and not GDAL.

If you want to work on with QGIS Lisboa, save the shapefile as UTF-8 and proceed with Solution A, until the next stable version of QGIS is released.


create a file named < filename >.cpg and 1253 as content in the same folder as the shapefile.

convert the shapefile with ogr2ogr:

ogr2ogr -a_srs EPSG:2100 -f GML nomoi_utf.gml nomoi_okxe.shp

ogr2ogr --config SHAPE_ENCODING "UTF-8" -a_srs EPSG:2100 nomoi_utf.shp nomoi_utf.gml

This allows GDAL to encode ISO-8859-7 on reading, and writes UTF-8. Unfortunately, writing to shp in one step does not work the same way. You can use the GML or the utf.shapefile with Solution A.

  • ISO-8859-7 is the root of all evils. Windows still saves in that encoding by default
    – nickves
    Commented Dec 15, 2012 at 11:54
  • ISO-8859-7 is the standard encoding for Greek alphabet support. You can't blame Greek authorities to use that. And it depends on your locale settings what Windows uses apart from utf-8.
    – AndreJ
    Commented Dec 15, 2012 at 12:14
  • 1
    I don't blame them. Although (trust me on this!) the world would be a better place is everyone used the same encoding routines. You can't imagine how many localized char sets, are out there, and how much guess work it needs to get it right. For example, if you don't know about the magic number 8859-7 , you'll only see gibberish.
    – nickves
    Commented Dec 15, 2012 at 12:34

This should be possible if you open the layer preferences, to to General and set the encoding to UTF-8.

Edit: Use OpenOffice to open the dbf, set the encoding to UTF-8 and then hit save. You may need to add and delete a letter to get the save-option.

  • Thanx, I tried it but doesn't work. There's also a 'greek' option but doesn't seem to work either. It should be possible but...
    – ZISIS
    Commented Dec 14, 2012 at 18:21
  • Try to save the shape file as a new one and set the encoding from the start to UTF...
    – GR_
    Commented Dec 14, 2012 at 18:29
  • what kind of encoding does the corresponding dbf- file have. is it utf-8 too?
    – Kurt
    Commented Dec 14, 2012 at 18:36
  • Thanx again, but it doesn't work either.
    – ZISIS
    Commented Dec 14, 2012 at 18:36
  • 2
    take a look here. gis.stackexchange.com/questions/31885/…
    – Kurt
    Commented Dec 14, 2012 at 20:21

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.