Bug report #15978
QgsRasterDataProvider::cStringList2Q_ without UTF8 support
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | Rasters | ||
Affected QGIS version: | 2.18.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 23894 |
Description
While (again) wondering why non-Latin characters are being garbled when metadata from TIFFTAGS are being read, I looked for the cause of this in QgsGdalProvider::metadata().
This uses the function QgsRasterDataProvider::cStringList2Q_ to read a c-stringlist.
There is a missing QString::fromUtf8() when the string is being read:
strings.append( QString::fromUtf8(stringList[i]) );
Before:
TIFFTAG_IMAGEDESCRIPTION[1811 Grundriss von Berlin / von neuem aufgenommen und mit Genehmigung der Königl. Academie der Wissenschaften hrsg. von J. C. Selter. Gestochen von C. Mare]
After:
TIFFTAG_IMAGEDESCRIPTION[1811 Grundriss von Berlin / von neuem aufgenommen und mit Genehmigung der Königl. Academie der Wissenschaften hrsg. von J. C. Selter. Gestochen von C. Mare]
This seems to be the only function inside QgsRasterDataProvider that needs such handling.
QgsOgrProvider uses a similar logic- in the FROM8 and TO8 macros, where QString::fromUtf8() is also used
- one can assume that non-latin characters will often be used
Associated revisions
History
#1 Updated by Mark Johnson over 7 years ago
- Target version changed from Future Release - Nice to have to Version 3.0
This matter needs to be resolved for QGIS 3, since it creates rubbish from any UTF8 string.
#2 Updated by Mark Johnson over 7 years ago
- Status changed from Open to Closed
Fixed in changeset 5ab8e7176b9ca470863c125ede4183a65df1ab68.