Skip to content

Commit

Permalink
QNX: assume QNX is always UTF-8
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sapiippo committed Jun 4, 2020
1 parent 8a0c16c commit 5781ef2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/corelib/kernel/qcoreapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include <private/qlocale_p.h>
#include <private/qlocking_p.h>
#include <private/qhooks_p.h>
#include <private/qtextcodec_p.h>

#ifndef QT_NO_QOBJECT
#if defined(Q_OS_UNIX)
Expand Down Expand Up @@ -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"; };
Expand Down

0 comments on commit 5781ef2

Please sign in to comment.