aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2022-05-31 12:29:58 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-16 22:26:44 +0000
commit19bafadc4840c7ed1f77e632821fcb732c0b93c9 (patch)
tree3cf35f1c054b879c95a192def85c4cde9c0a3601
parent67528dbf84b6ac3859b7f2a441bc747018a0de16 (diff)
Use QStringDecoder::decoderForHtml()
instead of QStringConverter::encodingForHtml(). The new method is more flexible and can also handle non unicode encodings if qtbase has been compiled with ICU support enabled. Change-Id: I50599c3afbcb48625d46b5590446bd2eec3890cd Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> (cherry picked from commit f3e981afb4d10c4e249c1738df9afc3d75328986) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index cd4ef6e42d..4d8c035971 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -1512,11 +1512,8 @@ QStringDecoder QQmlXMLHttpRequest::findTextDecoder() const
decoder = QStringDecoder(reader.documentEncoding().toString().toUtf8());
}
- if (!decoder.isValid() && m_mime == "text/html") {
- auto encoding = QStringConverter::encodingForHtml(m_responseEntityBody);
- if (encoding)
- decoder = QStringDecoder(*encoding);
- }
+ if (!decoder.isValid() && m_mime == "text/html")
+ decoder = QStringDecoder::decoderForHtml(m_responseEntityBody);
if (!decoder.isValid()) {
auto encoding = QStringConverter::encodingForData(m_responseEntityBody);