diff options
author | Lars Knoll <lars.knoll@qt.io> | 2022-05-31 12:29:58 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-16 23:37:07 +0000 |
commit | 483ab4d7d69fc8c5d69803be7316d27c7494b9cc (patch) | |
tree | 74f09986513f7a2646138178937792552389bc74 | |
parent | 692e9d91a49ce3ba94f32976d99c3e1840e8412f (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.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp index f4677b6848..daaeb16c13 100644 --- a/src/qml/qml/qqmlxmlhttprequest.cpp +++ b/src/qml/qml/qqmlxmlhttprequest.cpp @@ -1513,11 +1513,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); |