Skip to content

Commit 8b28b63

Browse files
authored
Merge pull request #8580 from rldhont/server-wms-decode-sld-218
[BUGFIX][Server] WMS: Decode loaded SLD files from SLD parameter
2 parents 1bb499e + bdd2aa9 commit 8b28b63

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/server/qgshttprequesthandler.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "qgsmapserviceexception.h"
2828
#include <QBuffer>
2929
#include <QByteArray>
30+
#include <QTextCodec>
3031
#include <QDomDocument>
3132
#include <QFile>
3233
#include <QImage>
@@ -602,7 +603,12 @@ void QgsHttpRequestHandler::requestStringToParameterMap( const QString& request,
602603
{
603604
continue; //only http and ftp supported at the moment
604605
}
605-
value = QString( fileContents );
606+
QTextCodec* codec = QTextCodec::codecForUtfText( fileContents, nullptr );
607+
if ( !codec )
608+
{
609+
codec = QTextCodec::codecForName( "UTF-8" );
610+
}
611+
value = codec->toUnicode( fileContents );
606612
#else
607613
QgsMessageLog::logMessage( "http and ftp methods not supported with Qt5." );
608614
continue;

0 commit comments

Comments
 (0)