summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-08-03 06:57:00 (GMT)
committerMontel Laurent <montel@kde.org>2016-08-03 06:58:49 (GMT)
commitba0c250bd5ad295ec0a6e6397580727a5140568f (patch)
tree4cb2b77db31ce4dc917abc3dc7c2a43e975c9a75
parenta84cfe5d03185ccf6cec0e6358fa3225d336d0ac (diff)
Add charset so we can open correctly in browser
-rw-r--r--webengineviewer/src/webengineexporthtmlpagejob.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/webengineviewer/src/webengineexporthtmlpagejob.cpp b/webengineviewer/src/webengineexporthtmlpagejob.cpp
index 859f3af..25bea7f 100644
--- a/webengineviewer/src/webengineexporthtmlpagejob.cpp
+++ b/webengineviewer/src/webengineexporthtmlpagejob.cpp
@@ -72,7 +72,9 @@ void WebEngineExportHtmlPageJob::slotSaveHtmlToPage(const QString &text)
}
QTextStream stream(&temporaryFile);
stream.setCodec("UTF-8");
- stream << text;
+ QString newText = text;
+ newText.replace(QStringLiteral("<!DOCTYPE html>"), QStringLiteral("<!DOCTYPE html><meta charset=\"UTF-8\">"));
+ stream << newText;
temporaryFile.close();
//We need to remove this temporary file
Q_EMIT success(temporaryFile.fileName());