Following data needs to be sorted respecting the locale sort order:
wird
sin
wär
pêche
war
Über
Uber
péché
peach
There was nor problem by using sort
$ sort < data
peach
pêche
péché
sin
Uber
Über
war
wär
wird
which respects the locale, and
$ LC_ALL=C sort < data
Uber
peach
péché
pêche
sin
war
wird
wär
Über
without locale.
Now I tried to do so with perl
, but I'm failed:
$ perl -e 'local $/ = undef; print sort <>;' < data
Über
pêche
war
péché
sin
Uber
peach
wär
wird
The result is either the first output of sort, nor the second.
Running Ubuntu 12.04 LTS
perl -e 'use locale; local $/ = undef; print sort <>;' < data
tell you?en_US.UTF-8
but it should work becausesort
without any settings works too and the data is inutf8
.