GNU bug report logs -
#19142
sort not working with LANG set to language_country.encoding
Previous Next
Reported by: Roland Sieker <ospalh <at> gmail.com>
Date: Fri, 21 Nov 2014 16:49:02 UTC
Severity: normal
Tags: notabug
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
Full log
Message #7 received at control <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tag 19142 notabug
thanks
On 11/21/2014 04:24 AM, Roland Sieker wrote:
> Hi.
>
> I have noticed that sort seems to have problems when the LANG environment
> variable is set with language and country.
>
Thanks for the report. The whole point of locales is that each locale
is free to choose the collation sequences that make the most sense for
that locale.
> It sorts OK like this, with LANG just the language.encoding:
> ( setenv LANG en.UTF-8 ; echo 'a\nb\na\n⺌\n⺕\n⺌' | sort )
[I'm translating your csh syntax into more-reliable sh syntax]
Try turning on sort debugging:
$ printf 'a\nb\na\n⺌\n⺕\n⺌' | LC_ALL=en.UTF-8 sort --debug
sort: using simple byte comparison
a
_
a
_
b
_
⺌
___
⺌
___
⺕
___
> But not with LANG as language_country.encoding:
$ printf 'a\nb\na\n⺌\n⺕\n⺌' | LC_ALL=en_GB.UTF-8 sort --debug
sort: using ‘en_GB.UTF-8’ sorting rules
⺌
__
⺕
__
⺌
__
a
_
a
_
b
_
That just means that whoever wrote the en_GB.UTF-8 locale picked a
different collation sequence for non-ascii characters than the person
that wrote the generic en.UTF-8 locale. That's not a bug in sort, so
I'm closing this as not a bug from coreutils' perspective. Feel free to
raise it as a glibc bug (the owner of locale definitions on GNU/Linux
systems) if you have a strong reason why different locales should be
more consistent on their choice of collation sequences. And feel free
to reply further to this bug with more questions or comments, even
though it has been closed.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 10 years and 218 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.