delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/03/24/10:44:57

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7255C38708A6
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1679669060;
bh=V0fD8/b2drLqnZUUGtUjE4AwkWg7W32l3LEJAbchhZo=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=YwgyvNdCNui5ScFI1mD0F0oYNmz4juNVxHQbRf/qq1vgx+fhYk9CrLL1s5h0W3+nB
mosg7kgnVQ/Q7YlGmvWlbwuIj7Z/7deETYSdrQ8htJXsPZ/e0rRZ/X/hvikbkxnsWu
Xj1MbiCl6KnJdJe2PSFLiKHLctvNe9bZ0VSVXeTc=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0F0538708B8
Date: Fri, 24 Mar 2023 15:44:02 +0100
To: cygwin AT cygwin DOT com
Subject: Re: newlocale: Linux incompatibility
Message-ID: <ZB23MkK34J5ZRo6K@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <bd7ebebc-cf90-d509-ef15-11d702a6126c AT cornell DOT edu>
<ZBzBL2jFO7Oltjd1 AT calimero DOT vinschen DOT de>
<ZB2U/JCFrwSUo1+U AT calimero DOT vinschen DOT de>
<5b6899da-555a-6574-6e8b-43c2288f636e AT cornell DOT edu>
MIME-Version: 1.0
In-Reply-To: <5b6899da-555a-6574-6e8b-43c2288f636e@cornell.edu>
X-Provags-ID: V03:K1:enmLOH/aBXUvt18V90g6nL14NR7cZwJoEo2BHQ4xwFY1+jDGcps
bFKOjzK1weklHLzvxk463ARQZCR1LsCoTfqeZpAFnUvNjKks/PFtKjxt2IAVuZHYHPBacSS
k2+gqCrmT4ZdTHEMk1I6ttKbkpgknOG7irGMRWT6Y8R0iND5rFQau3IVhg5WRo11QEZoEWc
Mqi7yj8II2WFzGofZP9Rg==
UI-OutboundReport: notjunk:1;M01:P0:NvRrEg3x/Ks=;fNavM/LejsOdCwYpHiX03gPOfIh
/df4ARSoafq3NoheMucssKCOWe3tH8DFckdv0DaLv9gd5XwaxhIZ+V5qBPTSXxw03ONrWE8n+
ctsdFaRG2nzeeZPwiC7edrkBPrmTy5RFRJAuNEgrTHZZVodfDb3pJ5150SKFnzp72EK20y1AS
eaz1iaqfOLUiWM4dPGUv8oYzzhMvCN5bO/wer7U/eFVo+Z/qA9fcTdmRWoDJmQEMZPgub/JuU
GaPAz8b916VGzgLVw07Rr8fJU/zm50bG8uvMnHRIdeuvowkD220nyOls3rWly80JqP7apwpsH
p5H/eImt/tI28rl8Hsk/iss+R5kKuERAWL3pXTMvtjVvDegKfZ/sLxLF7NWSHcVg+tRg2PBe2
9aHztoG2gbArNvOg+5dYevfXwWSciVkP22pVbALrQx0et7kntGCq1kmWDNCJJtmfMYzyCLVc9
Kr8CaG2xNAyO5THPLhT0kwoQE9pGJwCK08OrBKmEdndwV1dT2wHBIZijy4yxfzjC9P/w4jvxH
vdXkA2YynCv2ZyBFRFoJ86a8bOLkBBELxVlfio0MLSly/UW1KBZZGAYdfoNdApgzKJjtOK2eU
KqMvlKAz9lURlGSTZJWhnbSMglGgqq/9psR2NlYdHdl5Tvm2ENOJTJMfNDgeb7URnjXuzN2gV
uw1COIIQO4sXiDE1ijijwRFOhS4lQQiMf6Yv66f6VA==
X-Spam-Status: No, score=-97.6 required=5.0 tests=BAYES_00,
GOOD_FROM_CORINNA_CYGWIN, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H2, SPF_FAIL, SPF_HELO_NONE,
TXREP autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Mar 24 09:57, Ken Brown via Cygwin wrote:
> On 3/24/2023 8:18 AM, Corinna Vinschen via Cygwin wrote:
> > On Mar 23 22:14, Corinna Vinschen via Cygwin wrote:
> > > On Mar 23 15:48, Ken Brown via Cygwin wrote:
> > > > Consider the following test case:
> > > > 
> > > > $ cat locale_test.c
> > > > #include <stdio.h>
> > > > #include <locale.h>
> > > > 
> > > > int main ()
> > > > {
> > > >    const char *locale = "en_DE.UTF-8";
> > > >    locale_t loc = newlocale (LC_COLLATE_MASK | LC_CTYPE_MASK, locale, 0);
> > > >    if (!loc)
> > > >      perror ("newlocale");
> > > >    else
> > > >      printf ("newlocale succeeded on invalid locale %s\n", locale);
> > > > }
> > > > 
> > > > $ gcc -o locale_test locale_test.c
> > > > 
> > > > $ ./locale_test.exe
> > > > newlocale succeeded on invalid locale en_DE.UTF-8
> > > > 
> > > > On Linux, the newlocale call fails with ENOENT, as is documented on the man
> > > > page.
> > > Three bugs in fact.
> > > [...]
> > I pushed a couple of patches which hopefully clean up the code.
> > [...]
> > If you want to test this, the changes are in test release
> > 3.5.0-0.260.gb5b67a65f87c, which is just building.
> 
> That was fast!  I can confirm that newlocale now fails with ENOENT on the
> invalid locale en_XY.utf8.

Thanks for testing!


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019