|
From: | Paul Eggert |
Subject: | Re: Locale aware range expressions? |
Date: | Sun, 28 Jan 2024 18:29:53 -0800 |
User-agent: | Mozilla Thunderbird |
On 2024-01-27 18:43, Ronan Pigott wrote:
# locale aware collation, exactly as described in grep(1) $ print -l {a..d} {A..D} | sort
Not exactly. 'sort' sorts strings using an algorithm that is more complicated than simply comparing characters according to the collation sequence, because it uses weights. This is true even for single-character strings. This means that in general, you cannot use 'sort' to deduce a locale's collation sequence.
It's a messy area, specified more formally here: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/V1_chap07.html#tag_07_03_02
[Prev in Thread] | Current Thread | [Next in Thread] |