From 8113bd6d0dca0d9fcb38ea6a84a4a1bad660cd5a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 25 Jan 2023 17:07:07 +0400 Subject: Don't change process locale while initializing QWaylandInputContext This was overriding the locale previously set in QCoreApplicationPrivate::initLocale and can switch the process to non-UTF8 codepage Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59 Reviewed-by: Thiago Macieira (cherry picked from commit a3896c8a036c6a9b19d889c212769d72e70257c4) Reviewed-by: Qt Cherry-pick Bot --- src/client/qwaylandinputcontext.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index cb94005b3..8c023d495 100644 --- a/src/client/qwaylandinputcontext.cpp +++ b/src/client/qwaylandinputcontext.cpp @@ -222,9 +222,7 @@ void QWaylandInputContext::ensureInitialized() } m_initialized = true; - const char *locale = setlocale(LC_CTYPE, ""); - if (!locale) - locale = setlocale(LC_CTYPE, nullptr); + const char *const locale = setlocale(LC_CTYPE, nullptr); qCDebug(qLcQpaInputMethods) << "detected locale (LC_CTYPE):" << locale; m_composeTable = xkb_compose_table_new_from_locale(m_XkbContext, locale, XKB_COMPOSE_COMPILE_NO_FLAGS); -- cgit v1.2.3