Bug 19942 - LANG=en_US (the default) appears to fold lowercase to uppercase before sorting
LANG=en_US (the default) appears to fold lowercase to uppercase before sorting
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.0
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-27 17:02 EDT by Ronald Cole
Modified: 2007-04-18 12:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-27 18:56:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ronald Cole 2000-10-27 17:02:51 EDT
$ LANG= bash -c 'echo -e "a\nB" | sort'
B
a
$ LANG=en bash -c 'echo -e "a\nB" | sort'
B
a
$ LANG=en_US bash -c 'echo -e "a\nB" | sort'
a
B

!!!oops, that can't be right!!!   The same commands run on AIX and HPUX all
produce
identical output (as I would expect no difference between "en" and "en_US"
in this regard).
The GNU C Library Reference Manual says that "[d]efining and installing
named locales
[other than "C" or "POSIX" is normally a responsibility of ... the person
who installed the
GNU C library".  I guess that that would fall on Red Hat for installing a
broken locale and
making it the default.
Comment 1 Jakub Jelinek 2000-10-28 02:17:00 EDT
Actually, it is right. Open any printed vocabulary (be it English,
German, Norwegian or Czech) and see how entries are sorted.
The fact that sorting has been broken on most of the OSes
does not change anything on that. There is no such locale as en, so
it defaults to C, that's why the output of the first two is identical.
If you rely on ASCII sorting, use C locale, if you want native language
collation, use your own locale.
If AIX and HPUX don't fold cases, they are broken.
E.g. Solaris with en_US locale sorts the same way as RHL 7.0.
Comment 2 Ronald Cole 2000-10-28 18:13:16 EDT
Well, then the bug is RedHat defaulting to LANG=en_US.  It should probably 
default to either "C" or "POSIX" and the user should change it to "en_US" if 
that's what they want.  According the the GNU C Library Reference Manual, "C" 
and "POSIX" are the only ones that can be considered "portable" as all others
are obviously vendor supplied and therefore, extensions.
Comment 3 Ronald Cole 2000-10-28 19:15:59 EDT
I have entered bug #19973 against package "initscripts".

Note You need to log in before you can comment on or make changes to this bug.