ALT Linux Bugzilla – #15851
Sed ranges are broken in non-C locales
Last modified: 2008-06-13 13:00:10
You need to
before you can comment on or make changes to this bug.
When i use sed ranges (like [a-z]) in locales other than "C" uppercase letters
are matched by lowercase ranges.
In "C" locale this problem doesn't appear.
In other linux distributions (tested on Debian, Gentoo, Fedora) lowercase ranges
match only lowercase letters as one would expect. It seems this is because they
configure sed with --without-included-regex, while Alt does not.
Other utilities (like grep and tr) are not affected by this problem.
Steps to Reproduce:
1.Make sure that locale is not "C" (for example "ru_RU.UTF8")
2.echo abcdABCD | sed -e "s/[a-c]/0/g"
*** This bug has been marked as a duplicate of 13870 ***
(In reply to comment #1)
This problem has been solved in Gentoo (key --without-included-regex is used now).
Anyway sorting order should be the same for all utilities.
The following results are from the same locale:
[altlinux@localhost ~]$ echo abcdABCD | sed -e "s/[a-c]/0/g"
[altlinux@localhost ~]$ echo abcdABCD | grep -o "[a-c]"
[altlinux@localhost ~]$ echo abcdABCD | tr "[a-c]" 0
It can be obtained in both ru_RU.UTF-8 and ru_RU.KOI8-r locales so it's not the
*** This bug has been confirmed by popular vote. ***