[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort order bug in GNU sort

From: Luke Hutchison
Subject: Re: Sort order bug in GNU sort
Date: Thu, 29 Oct 2009 20:28:12 -0700

On Thu, Oct 29, 2009 at 7:53 PM, Eric Blake <address@hidden> wrote:
>> Could the manpage please be extended to give a simple example
>> comparing the sort order in the en_US locale with the C locale, to
>> make this much clearer?
> The man page comes from 'sort --help', and both try to be as concise as
> possible.  But the info pages would be a reasonable place to add another
> example, if it would help make it obvious what consequences are associated
> with alternate locales.  Would you like to try your hand at writing the
> patch, or at least propose the wording to use?

I understand that --help output needs to be relatively short,
nevertheless adding a short example will probably save lots of similar
questions on the mailing lists if the FAQ is correct in stating how
frequently this question is raised.


*** WARNING *** The locale specified by the environment affects sort
order.  Set LC_ALL=C to get the traditional sort order that uses
native byte values.

Suggested change:

*** WARNING *** The locale specified by the environment affects sort
order.  Assuming any given locale may cause unexpected or unportable
behavior.  For example, the en_US locale is case-insensitive and
ignores spaces and punctuation, while the C locale uses native byte
values and does not ignore either punctuation or spaces.  Set LC_ALL=C
before calling sort to get the traditional sort order.  An example of
different sort orders in two different locales using default switch

       en_US locale sort order:       C locale sort order:
       100,0,San Diego                10,1,San Juan
       10,1,San Juan                  10,1,San Tomas
       10,1,Santa Monica              10,1,Santa Monica
       10,1,San Tomas                 100,0,San Diego
       102,0,Santa Cruz               102,0,Santa Cruz

reply via email to

[Prev in Thread] Current Thread [Next in Thread]