[PATCH] Keep expected behaviour for [a-z] and [A-z] (Bug 23393).

Carlos O'Donell carlos@redhat.com
Thu Jul 26 13:25:00 GMT 2018


On 07/26/2018 04:18 AM, Andreas Schwab wrote:
> On Jul 26 2018, Florian Weimer <fweimer@redhat.com> wrote:
> 
>> The bash implementation of glob always uses strcoll/wcscoll ordering when
>> globasciirange is not active.  It does not use collation element ordering,
>> so rearranging collation data does not affect it.
> 
> Why does strcoll not agree with the collation sequence?

There are two terms that mean very different things.

The strcoll output and collation sequence are the same.

The collation sequence is not the same as the collation element ordering
(the order of the rules in the source file).

POSIX mandated the use of collation element ordering (not sequence) for
regular expression ranges, and then decided this was a bad idea and instead
made it unspecified.

In glibc we continue to implement and support collation element ordering,
not collation sequence, for posix regular expression ranges.

Even collation sequence is a bad idea because [a-z] does not include all the
z's that are sorted after z, and you need special collation element markers
like AFTER-Z to find all the z's. Instead we should use rational ranges
and make everything based on code points to make it portable across all
locales.

Cheers,
Carlos.



More information about the Libc-alpha mailing list