3 ms·
… ouch. So if you’re operating by locale, [a-z] and [A-Z] may do the wrong thing completely, including all but the first or last letter of the wrong case. Putt
by chrismorgan 8y ago
… ouch. So if you’re operating by locale, [a-z] and [A-Z] may do the wrong thing completely, including all but the first or last letter of the wrong case.
Putting lowercase before uppercase also surprises me; if asked to sort them, I’d definitely put uppercases before lowercases: AaBbCc…
- LukeShu 8y agoYes, that's why people found GNU awk <4.0 troublesome. Fortunately modern versions POSIX make regex range expressions ("[a-z]") unspecified behavior on locales other than "C", so modern versions of GNU awk and other GNU utilities "do the right thing". As for the en_US example, for the most part collation is case-insensitive, and case only comes in as a tiebreaker; "aa" < "Aa" < "ab".