Skip to content

Commit e53c4aa

Browse files
committed
support for cyrillic symbols in raster metadata (fix #4452)
1 parent d169b5a commit e53c4aa

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ QString QgsGdalProvider::metadata()
372372
myMetadata += tr( "Dataset Description" );
373373
myMetadata += "</p>\n";
374374
myMetadata += "<p>";
375-
myMetadata += QFile::decodeName( GDALGetDescription( mGdalDataset ) );
375+
myMetadata += FROM8( GDALGetDescription( mGdalDataset ) );
376376
myMetadata += "</p>\n";
377377

378378

src/providers/gdal/qgsgdalprovider.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ class QgsRasterPyramid;
3838
#define CPL_SUPRESS_CPLUSPLUS
3939
#include <gdal.h>
4040

41+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1800
42+
#define TO8F(x) (x).toUtf8().constData()
43+
#define FROM8(x) QString::fromUtf8(x)
44+
#else
45+
#define TO8F(x) QFile::encodeName( x ).constData()
46+
#define FROM8(x) QString::fromLocal8Bit(x)
47+
#endif
48+
4149
/** \ingroup core
4250
* A call back function for showing progress of gdal operations.
4351
*/

0 commit comments

Comments
 (0)