Fix system locale for Integrity

Integrity doesn't have langinfo, default locale is C, set to UTF-8

Change-Id: I6a6374195344641f64da895cd5f2745b61af060a
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Tuukka Turunen <tuukka.turunen@qt.io>
This commit is contained in:
Janne Koskinen 2021-05-19 12:17:27 +03:00
parent d5ab0101ff
commit 6ef69bcef2

View File

@ -105,7 +105,9 @@
#ifdef Q_OS_UNIX
# include <locale.h>
# include <langinfo.h>
# ifndef Q_OS_INTEGRITY
# include <langinfo.h>
# endif
# include <unistd.h>
# include <sys/types.h>
@ -591,6 +593,9 @@ void QCoreApplicationPrivate::initLocale()
return;
qt_locale_initialized = true;
#ifdef Q_OS_INTEGRITY
setlocale(LC_CTYPE, "UTF-8");
#else
// Android's Bionic didn't get nl_langinfo until NDK 15 (Android 8.0),
// which is too new for Qt, so we just assume it's always UTF-8.
auto nl_langinfo = [](int) { return "UTF-8"; };
@ -623,6 +628,7 @@ void QCoreApplicationPrivate::initLocale()
codec, oldLocale.constData(), newLocale.constData());
}
#endif
#endif
}