Re: sort bug?

Jim Meyering <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
stefano federici <[email protected]> wrote:
> It seems that the -f option (that is the "ignore-case" option) of sort doesn't
> work with accented characters. For example the following command
>
> sort -f -k1 input.txt > output.txt
>
> where input.txt contains:
>
> È 1
> à 2
> è 3
>
> will output the following output.txt file:
>
> È 1
> à 2
> è 3
>
> instead of the expected:
>
> à 2
> È 1
> è 3

What version of sort are you using? (run `sort --version')
What locale are you using? (run `locale')
The locale you use determines how bytes are ordered.
There are a few questions in the FAQ that should help you:

  http://www.gnu.org/software/fileutils/doc/faq/core-utils-faq.html

It works fine for me using the latest version and with
an appropriate locale settings:

  $ env LC_ALL=fr_FR sort -f < in
  à 2
  È 1
  è 3

If I use the default (C) locale, I get the
result that you didn't expect:

  $ sort -f < in
  È 1
  à 2
  è 3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.