[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [messagelib/Applications/17.08] webengineviewer/src: Fix specifying the charset when exporting as HT
From:       Wolfgang Bauer <null () kde ! org>
Date:       2017-08-09 6:16:41
Message-ID: E1dfKIL-0000WR-6K () code ! kde ! org
[Download RAW message or body]

Git commit 8f9f8d69d7ed3fa70e6af4ddd445daaf644c007a by Wolfgang Bauer.
Committed on 09/08/2017 at 06:14.
Pushed by wbauer into branch 'Applications/17.08'.

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"
"http://www.w3.org/TR/html4/loose.dtd">, not just <!DOCTYPE html>.

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

BUG: 374260
FIXED-IN: 17.08.0
Differential Revision: https://phabricator.kde.org/D7206

M  +1    -1    webengineviewer/src/webengineexporthtmlpagejob.cpp

https://commits.kde.org/messagelib/8f9f8d69d7ed3fa70e6af4ddd445daaf644c007a

diff --git a/webengineviewer/src/webengineexporthtmlpagejob.cpp \
b/webengineviewer/src/webengineexporthtmlpagejob.cpp index 6001fc80..76903190 100644
--- a/webengineviewer/src/webengineexporthtmlpagejob.cpp
+++ b/webengineviewer/src/webengineexporthtmlpagejob.cpp
@@ -73,7 +73,7 @@ void WebEngineExportHtmlPageJob::slotSaveHtmlToPage(const QString \
&text)  QTextStream stream(&temporaryFile);
     stream.setCodec("UTF-8");
     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;
     temporaryFile.close();
     //We need to remove this temporary file


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic