From 964be004033ea84dd4b8cbef53c4660b714dde09 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 23 May 2013 15:30:21 +0200 Subject: 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 --- tests/auto/corelib/codecs/qtextcodec/tst_qtextcodec.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') 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 = "Test"; 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 = "ͻ\000"; + QTest::newRow("greek text UTF-8") << html << 106 << 106; } void tst_QTextCodec::codecForHtml() -- cgit v1.2.3