Skip to content
Permalink
Browse files

[composer] Correctly handle encoded HTML source (fix #11287)

  • Loading branch information
nyalldawson committed Sep 30, 2014
1 parent 595de48 commit 184122571ac1d310de8c8906e512788ebbbb29a9
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgsnetworkcontentfetcher.cpp
@@ -21,6 +21,7 @@
#include "qgsmessagelog.h"
#include "qgsapplication.h"
#include <QNetworkReply>
#include <QTextCodec>

QgsNetworkContentFetcher::QgsNetworkContentFetcher()
: mReply( 0 )
@@ -64,7 +65,10 @@ QString QgsNetworkContentFetcher::contentAsString() const
}

QByteArray array = mReply->readAll();
return QString( array );

//correctly encode reply as unicode
QString content = QTextCodec::codecForHtml( array )->toUnicode( array );
return content;
}

void QgsNetworkContentFetcher::contentLoaded( bool ok )

0 comments on commit 1841225

Please sign in to comment.
You can’t perform that action at this time.