From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 20C661F910 for ; Tue, 15 Nov 2022 00:57:17 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.b="GJ0mkqYJ"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72A72384D0C6 for ; Tue, 15 Nov 2022 00:57:15 +0000 (GMT) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [81.169.146.160]) by sourceware.org (Postfix) with ESMTPS id E21EE38518AB for ; Tue, 15 Nov 2022 00:57:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E21EE38518AB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=clisp.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1668473821; s=strato-dkim-0002; d=clisp.org; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=JfsGpghmDZM1sJBDxxLAhbV9WlJAro3hk62etR6EBME=; b=GJ0mkqYJMzg4YIigoqoa6+EmRXOVjZCuLfslPJKbXC/g72NsY7JXBIANGxBHG0WbuX EoZQ2uZjw/RZlQaTlckYljnow/wUdFEjju04IsozDzhRYnbSPlw/ThyJsmkpx0YQ9Q/k Tn3EnNjtCHNQN4fCRngdFFE7nUe0R8WtIZpTumZb6QZzRgdlmBH1BuiJSJtAmURhMA0m AyZQucDurR/OH5hJQH6ezExiPFsyRYeNzEQRE+JfyqBkIaPTVLObsMKq+4mlTC9zQGC5 pvR1JroVc7uOrRTORWkgzbEK41qBSSFC/UtxJXT+fYnEE4AEnGG0QC4gcr3oeWzGbBeA iAoA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPF26eS8oSkn60A0GUzjAXJYguA" X-RZG-CLASS-ID: mo00 Received: from nimes.fritz.box by smtp.strato.de (RZmta 48.2.1 AUTH) with ESMTPSA id v9c7e6yAF0v0qus (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 15 Nov 2022 01:57:00 +0100 (CET) From: Bruno Haible To: libc-alpha@sourceware.org Cc: Bruno Haible Subject: [PATCH] intl: Treat C.UTF-8 locale like C locale (BZ# 16621) Date: Tue, 15 Nov 2022 01:56:23 +0100 Message-Id: <20221115005623.3774099-1-bruno@clisp.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" 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. --- intl/dcigettext.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index 1fc074a414..6a3c248e68 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 -- 2.34.1