Skip to content

Commit

Permalink
[BUGFIX][Server] WMS: Decode loaded SLD files from SLD parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Dec 3, 2018
1 parent 1bb499e commit bdd2aa9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/server/qgshttprequesthandler.cpp
Expand Up @@ -27,6 +27,7 @@
#include "qgsmapserviceexception.h"
#include <QBuffer>
#include <QByteArray>
#include <QTextCodec>
#include <QDomDocument>
#include <QFile>
#include <QImage>
Expand Down Expand Up @@ -602,7 +603,12 @@ void QgsHttpRequestHandler::requestStringToParameterMap( const QString& request,
{
continue; //only http and ftp supported at the moment
}
value = QString( fileContents );
QTextCodec* codec = QTextCodec::codecForUtfText( fileContents, nullptr );
if ( !codec )
{
codec = QTextCodec::codecForName( "UTF-8" );
}
value = codec->toUnicode( fileContents );
#else
QgsMessageLog::logMessage( "http and ftp methods not supported with Qt5." );
continue;
Expand Down

0 comments on commit bdd2aa9

Please sign in to comment.