Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[OGR] Ensure metadata saved file is UTF-8 encoded
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Mar 28, 2023
1 parent 9f1e336 commit 41d2819
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/providers/ogr/qgsogrprovidermetadata.cpp
Expand Up @@ -1071,6 +1071,9 @@ bool QgsOgrProviderMetadata::saveLayerMetadata( const QString &uri, const QgsLay
if ( qmdFile.open( QFile::WriteOnly | QFile::Truncate ) )
{
QTextStream fileStream( &qmdFile );
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
fileStream.setCodec( "UTF-8" );
#endif
fileStream << metadataXml;
qmdFile.close();
return true;
Expand Down

0 comments on commit 41d2819

Please sign in to comment.