From: GNU Libc Maintainers Date: Wed, 31 Jan 2024 20:45:37 +0000 (+0100) Subject: git-c-utf-8-language X-Git-Tag: archive/raspbian/2.37-15_deb13u1+rpi1^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=897f41439a9535afbb05c97bb08f6eb5a736d928;p=glibc.git git-c-utf-8-language commit 2897b231a6b71ee17d47d3d63f1112b2641a476c Author: Bruno Haible Date: Mon Sep 4 15:31:36 2023 +0200 intl: Treat C.UTF-8 locale like C locale (BZ# 16621) The wiki page https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 says that "Setting LC_ALL=C.UTF-8 will ignore LANGUAGE just like it does with LC_ALL=C." This patch implements it. * intl/dcigettext.c (guess_category_value): Treat C. locale like the C locale. Reviewed-by: Florian Weimer Gbp-Pq: Topic any Gbp-Pq: Name git-c-utf-8-language.diff --- diff --git a/intl/dcigettext.c b/intl/dcigettext.c index d0c62eec7..5f12a4d95 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -1564,8 +1564,12 @@ guess_category_value (int category, const char *categoryname) 2. The precise output of some programs in the "C" locale is specified by POSIX and should not depend on environment variables like "LANGUAGE" or system-dependent information. We allow such programs - to use gettext(). */ - if (strcmp (locale, "C") == 0) + to use gettext(). + Ignore LANGUAGE and its system-dependent analogon also if the locale is + set to "C.UTF-8" or, more generally, to "C.", because that's + the by-design behaviour for glibc, see + . */ + if (locale[0] == 'C' && (locale[1] == '\0' || locale[1] == '.')) return locale; /* The highest priority value is the value of the 'LANGUAGE' environment