I set my shapefiles UTF-8 encoding which supposed to display Arabic fine, but it doesn't work in QGIS unless I change the encoding to Windows-1256. QGIS reads the arabic well with this encoding.

But when I publish to Geoserver using the plugin or by uploading the shapefile and specify the exact same encoding or connected via Postgre it doesn't work in layer preview or GeoExplorer or when I add the WMS into ArcGIS, for example.

Does anyone have any recommendations for eastern languages encoding especially arabic? Why is this happening while it should work fine?

1 Answer 1


What I do in cases like this is change the encoding in the dbf file (part of the shapefile collection). This can be done with LibreOffice, for example. First make a backup copy of the original shapefile - all components. Then you open the dbf with LibreOffice, and specify Windows-1256 encoding. Then save back, but using UTF-8 encoding. Now when you open the shapefile in QGIS, you should see the labels OK, without setting any special encoding. Then when you upload to the web, labels should appear properly.

I mention LibreOffice because 1)it's FOSS and 2)I think that new versions of MS Excel do not read *.dbf any longer. And the process for defining the output encoding is somewhat complicated.

If the attribute table became empty, then go back to the original *.dbf, try to open/ save and close without making any changes. And then check with QGIS.

And an additional comment: when you load/save a shapefile in QGIS there's an option to select the encoding. You mentioned that you change the encoding to WINDOWS-1256 when you read the shapefile. In a similar way you can save to a new shapeifle with "Save As..." and select UTF-8 encoding in the save dialog. Then use this new shapefile in Geoserver. This is probably the easiest.

  • is LibreOffice something specific ? i tried to do that with excel and did what you said but in Qgis the attribute table was empty Commented Sep 13, 2016 at 21:36
  • I added some edits to the answer above
    – Micha
    Commented Sep 16, 2016 at 13:12

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.