From nobody Mon Apr 17 21:33:04 2023 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Q0gJh5w6Rz45DVp for ; Mon, 17 Apr 2023 21:33:08 +0000 (UTC) (envelope-from yuri@aetern.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Q0gJh4BWTz4L5j for ; Mon, 17 Apr 2023 21:33:08 +0000 (UTC) (envelope-from yuri@aetern.org) Authentication-Results: mx1.freebsd.org; none Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CAC275C0038; Mon, 17 Apr 2023 17:33:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 17 Apr 2023 17:33:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aetern.org; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1681767187; x=1681853587; bh=jqP7xwgzsB3O9w2f17V2Voy/M4rCWzIKVt7 nv8vY/uo=; b=WbbINQRNayGV4EVBoKrUmq8D1foEjw11Lpje/7Nm3gKr7FK+XXG e0lhI6Ukwyu9BrtCRwFtPQqfqtiyOT9g1wZtHSY2JZ3PCNpRSaGYDGGoeXm/cUFT 4sMJvRgNGoeBS/IKt8ckgBj229NxoiL6/72rEHQAPTU16FGq0EAULlzuTUpu1zdK emHvR4KJzAHIofuFBDqkWN8oG6QxFVZ4YEdoN8Ekfq+AmaRoCv8/ZA2PQ9eOAsM+ JX+q4L3mz2t7D3HyXcfiA0VNFGQDeOQMOKO3RwS9HmFIyxdEKh5q2CRvQiAqDY8D Ta33dNGUnzstDzZiTvedYSGkPfjfCSpV/DA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1681767187; x=1681853587; bh=jqP7xwgzsB3O9w2f17V2Voy/M4rCWzIKVt7 nv8vY/uo=; b=Xqb0T0RZtTzMAC05iB3q9u9y0i/MFsocBu5EobuVRimti54J8LH +VMO//J1h67526qKs4tfYz6jZuW1HQl9LP2vYz40QUpz1+cJkot8CNBNtC18Hj2b pEIj/S/K03vo5Nio62IjMXC3/hxmaAI5wxFwDUlHjdwO0fVU9wZG4scCIrq4mRIc hU/5lsuaSOW2UohLJx04gVLAECTN51jpV5iRREWnpkDBZPzOpZ/rQb03maR8UN96 YmK9ikbA1UE2djDyO282L4GdZm9WQxjdimCvd9Rr9yryrj1xbH0PHXwcK/G4xHjo EBVYBqDsyUeHvCRbYTZ6GZWpeGL1J7rOyqg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeliedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfuffvvehfhfgjtgfgse htkeertddtfeejnecuhfhrohhmpegjuhhrihcuoeihuhhrihesrggvthgvrhhnrdhorhhg qeenucggtffrrghtthgvrhhnpefghfffleejhfefhfettddtjeejjeefheeiuefhtdeihf duueegfffhteehueegffenucffohhmrghinhepohhpvghnghhrohhuphdrohhrghenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeihuhhrihesrg gvthgvrhhnrdhorhhg X-ME-Proxy: Feedback-ID: i0d79475b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Apr 2023 17:33:06 -0400 (EDT) Message-ID: <6dd71202-4144-8587-b42c-8db44a4b737e@aetern.org> Date: Mon, 17 Apr 2023 23:33:04 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: find(1): I18N gone wild ? Content-Language: en-US To: Xin LI , Poul-Henning Kamp Cc: current@freebsd.org References: <202304172106.33HL6RUX051407@critter.freebsd.dk> From: Yuri In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Q0gJh4BWTz4L5j X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:19151, ipnet:66.111.4.0/24, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N Xin LI wrote: > This is expected behavior (in en_US.UTF-8 the ordering is AaBb, not > ABab).  You might want to set LC_COLLATE to C if C behavior is desirable. > > On Mon, Apr 17, 2023 at 2:06 PM Poul-Henning Kamp > wrote: > > This surprised me: > >         # mkdir /tmp/P >         # cd /tmp/P >         # touch FOO >         # touch bar >         # env LANG=C.UTF-8 find . -name '[A-Z]*' -print >         ./FOO >         # env LANG=en_US.UTF-8 find . -name '[A-Z]*' -print >         ./FOO >         ./bar > > Really ?! A bit more detail: find uses fnmatch(3) here, where the RE Bracket Expression rules apply (except for ! instead of ^, but that's unrelated): https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05 ...which has the following note: 7. In the POSIX locale, a range expression represents the set of collating elements that fall between two elements in the collation sequence, inclusive. In other locales, a range expression has unspecified behavior: strictly conforming applications shall not rely on whether the range expression is valid, or on the set of collating elements matched. Indeed, it's unfortunate that collations in non-POSIX are not that... linear and range expressions can break, but I don't see an easy way of "fixing" this.