Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2023 14:24:59 -0700
From:      Xin LI <delphij@gmail.com>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: find(1): I18N gone wild ?
Message-ID:  <CAGMYy3tz6iCU_tiE6NHoVPdXOZGtP%2BfskWMrLXyev8SR=xRSqQ@mail.gmail.com>
In-Reply-To: <202304172106.33HL6RUX051407@critter.freebsd.dk>
References:  <202304172106.33HL6RUX051407@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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 <phk@phk.freebsd.dk>
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 ?!
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>
>

[-- Attachment #2 --]
<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace">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.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 17, 2023 at 2:06 PM Poul-Henning Kamp &lt;<a href="mailto:phk@phk.freebsd.dk">phk@phk.freebsd.dk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This surprised me:<br>
<br>
        # mkdir /tmp/P<br>
        # cd /tmp/P<br>
        # touch FOO<br>
        # touch bar<br>
        # env LANG=C.UTF-8 find . -name &#39;[A-Z]*&#39; -print<br>
        ./FOO<br>
        # env LANG=en_US.UTF-8 find . -name &#39;[A-Z]*&#39; -print<br>
        ./FOO<br>
        ./bar<br>
<br>
Really ?!<br>
<br>
-- <br>
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20<br>
phk@FreeBSD.ORG         | TCP/IP since RFC 956<br>
FreeBSD committer       | BSD since 4.3-tahoe<br>
Never attribute to malice what can adequately be explained by incompetence.<br>
<br>
</blockquote></div>

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGMYy3tz6iCU_tiE6NHoVPdXOZGtP%2BfskWMrLXyev8SR=xRSqQ>