diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2013-05-23 15:30:21 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 16:55:30 +0200 |
commit | 964be004033ea84dd4b8cbef53c4660b714dde09 (patch) | |
tree | 3808d233c943dd5d7e29d12e0007f4a534f7291c /tests | |
parent | 26ae24e20b47d327508cae77751f677248cb4a32 (diff) |
Fix regression when pasting into QTextEdit from Firefox.
Return the codec if one was found by QTextCodec::codecForUtfText,
instead of returning the default (UTF-8).
Task-number: QTBUG-31293
Change-Id: I95e3260376c00537006b7fbfdc3df5850e1ba657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp index b5f736cfbb..616fe33309 100644 --- a/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp +++ b/tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp @@ -1917,6 +1917,17 @@ void tst_QTextCodec::codecForHtml_data() html = "<!DOCTYPE html><html><head><meta charset=\" utf' 8 /><title>Test</title></head>"; QTest::newRow("invalid charset, early terminator (')") << html << noDefault << fallback; + + const char src[] = { char(0xff), char(0xfe), char(0x7a), char(0x03), 0, 0 }; + html = src; + QTest::newRow("greek text UTF-16LE") << html << 106 << 1014; + + html = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><span style=\"color: rgb(0, 0, 0); font-family: " + "'Galatia SIL'; font-size: 27px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; " + "line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: " + "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; } void tst_QTextCodec::codecForHtml() |