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/qtextcodec.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/qtextcodec.cpp')
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 3b0afdd6cc..6fef7794e6 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -54,15 +54,6 @@ #endif #include "private/qcoreglobaldata_p.h" -#if !defined(QT_BOOTSTRAPPED) -#if !defined(QT_NO_ICONV) -# include "qiconvcodec_p.h" -#endif -#ifdef Q_OS_WIN -# include "qwindowscodec_p.h" -#endif -#endif - #include "qutfcodec_p.h" #include "qlatincodec_p.h" @@ -72,6 +63,12 @@ #if defined(QT_USE_ICU) #include "qicucodec_p.h" #else +#if !defined(QT_NO_ICONV) +# include "qiconvcodec_p.h" +#endif +#ifdef Q_OS_WIN +# include "qwindowscodec_p.h" +#endif # include "qsimplecodec_p.h" #if !defined(QT_NO_BIG_CODECS) # ifndef Q_OS_INTEGRITY @@ -173,10 +170,12 @@ static QTextCodec *setupLocaleMapper() QCoreApplicationPrivate::initLocale(); #endif -#if defined(Q_OS_WIN) || defined(Q_OS_WINCE) - locale = QTextCodec::codecForName("System"); -#elif defined(Q_OS_MAC) || defined(Q_OS_IOS) || defined(Q_OS_LINUX_ANDROID) || defined(Q_OS_QNX) +#if defined(Q_OS_MAC) || defined(Q_OS_IOS) || defined(Q_OS_LINUX_ANDROID) || defined(Q_OS_QNX) locale = QTextCodec::codecForName("UTF-8"); +#elif defined(QT_USE_ICU) + locale = QIcuCodec::defaultCodec(); +#elif defined(Q_OS_WIN) || defined(Q_OS_WINCE) + locale = QTextCodec::codecForName("System"); #else // First try getting the codecs name from nl_langinfo and see @@ -287,13 +286,13 @@ static void setup() (void)new QBig5Codec; (void)new QBig5hkscsCodec; # endif // !QT_NO_BIG_CODECS && !Q_OS_INTEGRITY -#endif // QT_USE_ICU #if !defined(QT_NO_ICONV) (void) new QIconvCodec; #endif #if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) (void) new QWindowsLocalCodec; #endif // Q_OS_WIN32 +#endif // QT_USE_ICU #endif // !QT_NO_CODECS && !QT_BOOTSTRAPPED (void)new QUtf16Codec; |