Commit 8f9f8d69 authored by Wolfgang Bauer's avatar Wolfgang Bauer

Fix specifying the charset when exporting as HTML

The QString::replace() had no effect because the stream actually
contains <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"">, not just <!DOCTYPE html>.

Also, the <meta> tag should be inside the <head> section.

BUG: 374260
FIXED-IN: 17.08.0
Differential Revision:
parent adafa317
......@@ -73,7 +73,7 @@ void WebEngineExportHtmlPageJob::slotSaveHtmlToPage(const QString &text)
QTextStream stream(&temporaryFile);
QString newText = text;
newText.replace(QStringLiteral("<!DOCTYPE html>"), QStringLiteral("<!DOCTYPE html><meta charset=\"UTF-8\">"));
newText.replace(QStringLiteral("<head>"), QStringLiteral("<head><meta charset=\"UTF-8\">"));
stream << newText;
//We need to remove this temporary file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment