Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have googled a lot but failed to find the answer.

My configuration is:

  • Ubuntu 11.10
  • Quantum GIS - 1.9.0-Master 'Master' (caae7b7)
  • GDAL 1.9.2, released 2012/10/08

Shape-files refuse to open in correct encoding. I have some of them in CP1251 encoding. It seems that the problem is already solved. http://trac.osgeo.org/gdal/ticket/4650

I have the latest GDAL library and nothing helps.

Can anyone tell me how to debug GDAL? How can I understand if GDAL handles shp-files correctly (in terms of encoding)?

share|improve this question
    
Did you try to encode the shapefile with qgis using layer -> save as (then selecting the proper encoding)? –  U2ros Oct 23 '12 at 13:01
    
Yes, I did. No luck. –  Vladimir Oct 23 '12 at 13:08

2 Answers 2

up vote 4 down vote accepted

There is something fundamentally wrong with GDAL's shapefile encoding detection feature. In latest QGIS 1.9 builds, you can ignore GDAL's shapefile encoding by going into the Options window and checking the [ ] Ignore shapefile encoding. You can then set the correct encoding in the layer property window.

See http://hub.qgis.org/projects/quantum-gis/repository/revisions/75dc85b4d652116814873bb7674cab15ce6cde66 and its related issues for more background.

share|improve this answer
    
Thanks nirvn! That solved my problem! I will post the solution to other places where I have asked. –  Vladimir Oct 23 '12 at 13:41
    
The key is to set the correct encoding in the layer property window. Thanks! –  Michele Virgilio Jul 4 at 7:29

You can set -lco ENCODING=UTF-8 (or 1251) as parameter in GDAL ogr2ogr, or enter it in the layer option field inside qgis when saving.

share|improve this answer
    
I am particularly interested in opening shp-files with correct encoding. Your advise didn't help, I tried it with my data. '?????' instead of text. –  Vladimir Oct 23 '12 at 13:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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