summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-04-24 09:39:47 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-04-24 10:42:41 (GMT)
commitfbdf2d74f010c85c85af4ee9ea793039cccf2354 (patch)
treebfaaba699bdbff6929b6499db8902820547a1065
parent294f32f41da900ad3ae70e1546ea0057f8864d95 (diff)
downloadQt-fbdf2d74f010c85c85af4ee9ea793039cccf2354.zip
Qt-fbdf2d74f010c85c85af4ee9ea793039cccf2354.tar.gz
Qt-fbdf2d74f010c85c85af4ee9ea793039cccf2354.tar.bz2
Return the correct MIB number for TSCII. When the code was
written, IANA hadn't assigned one. Requested/spotted by Nokia i18n team. Task-number: 251790 Reviewed-by: Brad Reviewed-by: Denis AutoTest: In this submit.
-rw-r--r--src/corelib/codecs/qtsciicodec.cpp3
-rw-r--r--tests/auto/qtextcodec/tst_qtextcodec.cpp6
2 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/codecs/qtsciicodec.cpp b/src/corelib/codecs/qtsciicodec.cpp
index 14d2c9c..0ec0567 100644
--- a/src/corelib/codecs/qtsciicodec.cpp
+++ b/src/corelib/codecs/qtsciicodec.cpp
@@ -180,8 +180,7 @@ QByteArray QTsciiCodec::name() const
*/
int QTsciiCodec::mibEnum() const
{
- /* There is no MIBEnum for TSCII now */
- return -3197;
+ return 2107;
}
static const int UnToTsLast = 124; // 125 items -- so the last will be 124
diff --git a/tests/auto/qtextcodec/tst_qtextcodec.cpp b/tests/auto/qtextcodec/tst_qtextcodec.cpp
index 536b695..cf4135b 100644
--- a/tests/auto/qtextcodec/tst_qtextcodec.cpp
+++ b/tests/auto/qtextcodec/tst_qtextcodec.cpp
@@ -69,6 +69,7 @@ private slots:
void decode0D() const;
void codecForIndex() const;
void aliasForUTF16() const;
+ void mibForTSCII() const;
void utf8Codec_data();
void utf8Codec();
@@ -459,6 +460,11 @@ void tst_QTextCodec::aliasForUTF16() const
QVERIFY(QTextCodec::codecForName("UTF-16")->aliases().isEmpty());
}
+void tst_QTextCodec::mibForTSCII() const
+{
+ QCOMPARE(QTextCodec::codecForName("TSCII")->mibEnum(), 2107);
+}
+
static QString fromInvalidUtf8Sequence(const QByteArray &ba)
{
return QString().fill(QChar::ReplacementCharacter, ba.size());