From f9f2eee3f9aa0396ef141ecd49ae43dba8a526c5 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 18 Jan 2010 16:33:02 +0100 Subject: QTextCodec: Symbian has codec for UCS2, only fallback to UTF16 if UCS2 codec cannot be loaded Reviewed-by: Denis --- src/corelib/codecs/qtextcodec.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 2d332e9..ef7528d 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -1012,11 +1012,6 @@ QTextCodec* QTextCodec::codecForMib(int mib) if (codec) return codec; - // Qt 3 used 1000 (mib for UCS2) as its identifier for the utf16 codec. Map - // this correctly for compatibility. - if (mib == 1000) - mib = 1015; - QList::ConstIterator i; for (int i = 0; i < all->size(); ++i) { QTextCodec *cursor = all->at(i); @@ -1027,6 +1022,12 @@ QTextCodec* QTextCodec::codecForMib(int mib) } codec = createForMib(mib); + + // Qt 3 used 1000 (mib for UCS2) as its identifier for the utf16 codec. Map + // this correctly for compatibility. + if (!codec && mib == 1000) + return codecForMib(1015); + if (codec) cache.insert(mib, codec); return codec; -- cgit v0.12