Skip to content

Commit

Permalink
[composer] Correctly handle encoded HTML source (fix #11287)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 30, 2014
1 parent 595de48 commit 1841225
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsnetworkcontentfetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "qgsmessagelog.h"
#include "qgsapplication.h"
#include <QNetworkReply>
#include <QTextCodec>

QgsNetworkContentFetcher::QgsNetworkContentFetcher()
: mReply( 0 )
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 1841225

Please sign in to comment.