From 5781ef2013160ba3810ad7df399aa79be085cd6c Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Mon, 25 May 2020 16:35:01 +0300 Subject: QNX: assume QNX is always UTF-8 Override locale encoding to UTF-8 on supported platforms. QNX has nl_langinfo, but the header is not using extern "C". Tests show that it returns UTF-8 regardless of the locale, so let's assume it's always UTF-8. Change-Id: I0fe98f8441287df9f99c334e537a7b962df105f6 Reviewed-by: Thiago Macieira --- src/corelib/kernel/qcoreapplication.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index b3aa8f5a51..43f641244b 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -73,6 +73,7 @@ #include #include #include +#include #ifndef QT_NO_QOBJECT #if defined(Q_OS_UNIX) @@ -594,7 +595,7 @@ void QCoreApplicationPrivate::initLocale() return; qt_locale_initialized = true; -#ifdef Q_OS_ANDROID +#ifdef QT_LOCALE_IS_UTF8 // 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"; }; -- cgit v1.2.3