diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2012-07-25 10:17:44 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-31 11:12:44 +0200 |
commit | b23f048cf9a8eca4a246c65298818c38a4338fe4 (patch) | |
tree | 9bd8c34dca71efc2aa9ded533fb8b7764ec1963f /src/corelib/codecs/qicucodec.cpp | |
parent | 34721c4d3690335d2d9fe79620e566fda78de25b (diff) |
Use ICU instead of iconv/windows codecs for the locale
With ICU there's no need to use the windows locale or iconv
codecs anymore as locale codecs.
Change-Id: I50c94a97ed6acbf4c6f05b2a88593a57ebfa8342
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/codecs/qicucodec.cpp')
-rw-r--r-- | src/corelib/codecs/qicucodec.cpp | 16 |
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; } |