diff options
author | Janne Koskinen <janne.p.koskinen@qt.io> | 2021-05-19 12:17:27 +0300 |
---|---|---|
committer | Janne Koskinen <janne.p.koskinen@qt.io> | 2021-06-02 18:30:04 +0300 |
commit | 6ef69bcef2785baf112b6f91f05995fc01869928 (patch) | |
tree | 41510d6b18b89bdd807b460599f7157e9bdd37fd /src/corelib/kernel/qcoreapplication.cpp | |
parent | d5ab0101ffaaa36ccefda80e3a7a1eb5c60070d5 (diff) |
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>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 2969b24801..b59781a4bf 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -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 } |