diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-27 10:45:47 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-10-28 12:17:13 +0100 |
commit | 1abcc1cd3d1a8d04ccfd711c3293d0c671af3c78 (patch) | |
tree | 9e035ed1d4748d4fd8d469961b71e460a7f7d85a /tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp | |
parent | 6080db8c6d345cf4ad573215828246e86f9dc41b (diff) | |
download | qtbase-1abcc1cd3d1a8d04ccfd711c3293d0c671af3c78.tar.gz |
Hardcode UTF-8 for "unicode" in QTextCodec::codecForHtml().
ICU would return a utf-16 (endian dependent) codec for unicode
which is very rarely what people want. In most cases, unicode is
encoded in utf8 these days, so return a utf8 codec for it.
Task-number: QTBUG-41998
Change-Id: I51ee758d520702b263a8b2011787eb1f3455ed96
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp')
-rw-r--r-- | tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index 4e3d5c64bc..df2f97ce0e 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -1996,6 +1996,10 @@ void tst_QTextCodec::codecForHtml_data() "auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: " "none;\">ͻ</span>\000"; QTest::newRow("greek text UTF-8") << html << 106 << 106; + + html = "<!DOCTYPE html><html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=unicode\">" + "<head/><body><p>bla</p></body></html>"; // QTBUG-41998, ICU will return UTF-16. + QTest::newRow("legacy unicode UTF-8") << html << 106 << 106; } void tst_QTextCodec::codecForHtml() |