Package: coreutils
Version: 8.25-2ubuntu3~16.0 (from xenial-updates)

If not `LC_ALL=C` is set, the sort result is weird.

Please inspect this sample code:
cat <<EOF | sort --unique --debug
a-ab
aac
a-ac
EOF


Running it with `LC_ALL=C` everything is fine:
> sort: using simple byte comparison
> a-ab
> ____
> a-ac
> ____
> aac
> ___
> 


But switching to en_US.UTF-8 or de_DE.UTF-8 I got the broken result:
> sort: using 
> a-ab
> ____
> aac
> ___
> a-ac
> ____
> 

So any algorithm or script which depends on a stable sorted order will
fail.

As a mitigation I tried `LC_COLLATE=C`  but still the ‘en_US.UTF-8’
sorting rules will be used :-/

Reply via email to