summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qicucodec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs/qicucodec.cpp')
-rw-r--r--src/corelib/codecs/qicucodec.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp
index c91115b3b5..56efcad14e 100644
--- a/src/corelib/codecs/qicucodec.cpp
+++ b/src/corelib/codecs/qicucodec.cpp
@@ -372,7 +372,6 @@ QList<QByteArray> QIcuCodec::availableCodecs()
// handled by Qt and not in ICU:
codecs += "TSCII";
- codecs += "System";
return codecs;
}
@@ -389,6 +388,21 @@ QList<int> QIcuCodec::availableMibs()
return mibs;
}
+QTextCodec *QIcuCodec::defaultCodec()
+{
+ QCoreGlobalData *globalData = QCoreGlobalData::instance();
+ if (!globalData)
+ return 0;
+ QTextCodec *c = globalData->codecForLocale.loadAcquire();
+ if (c)
+ return c;
+
+ const char *name = ucnv_getDefaultName();
+ c = codecForName(name);
+ globalData->codecForLocale.storeRelease(c);
+ return c;
+}
+
static inline bool nameMatch(const QByteArray &a, const char *b)
{ return a == b; }