From: Ivailo Monev Date: Wed, 7 Aug 2019 22:07:12 +0000 (+0000) Subject: use iconv codec as fallback, not default X-Git-Tag: 4.12.0~5162 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=215ced5fb8d4fef90c789f67b3581a1b4e72544d;p=kde%2FKatie.git use iconv codec as fallback, not default Signed-off-by: Ivailo Monev --- diff --git a/src/core/codecs/qtextcodec.cpp b/src/core/codecs/qtextcodec.cpp index a95ad387e..2729679c2 100644 --- a/src/core/codecs/qtextcodec.cpp +++ b/src/core/codecs/qtextcodec.cpp @@ -311,10 +311,6 @@ static QTextCodec *checkForCodec(const QByteArray &name) { */ static void setupLocaleMapper() { -#ifndef QT_NO_ICONV - localeMapper = QTextCodec::codecForName("System"); -#endif - #if defined (_XOPEN_UNIX) && !defined(Q_OS_OSF) if (!localeMapper) { char *charset = nl_langinfo (CODESET); @@ -420,10 +416,15 @@ static void setupLocaleMapper() } +#ifndef QT_NO_ICONV + if (!localeMapper) + localeMapper = QTextCodec::codecForName("System"); +#else // If everything failed, we default to 8859-1 // We could perhaps default to 8859-15. if (!localeMapper) localeMapper = QTextCodec::codecForName("ISO 8859-1"); +#endif } #ifndef QT_NO_THREAD