From a3896c8a036c6a9b19d889c212769d72e70257c4 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 Pick-to: 6.5 6.4 6.2 Change-Id: I5cd6664d1a7c315019d6c798b33b9deb33982a59 Reviewed-by: Thiago Macieira --- src/client/qwaylandinputcontext.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp index e67311a1..3af55bcc 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.1