1

Does anybody have a good explanation why Spanish locale sort order differs between CentOs 6.9 and Ubuntu 18.04:

On CentOS release 6.9:

$ export LC_COLLATE=es_ES.utf8
$ echo "niño ninja ninus" | tr ' ' '\n' | sort
ninja
niño
ninus

And on Ubuntu 18.04

$ export LC_COLLATE=es_ES.utf8
$ echo "niño ninja ninus" | tr ' ' '\n' | sort
ninja
ninus
niño

So in Centos6.9 "niño" is sorted before "ninus" while Ubuntu 18.04 reverses that order.

6
  • Can not reproduce. Commented Feb 19, 2021 at 16:12
  • Was due to a difference in underlying operating systems (experiments were run in different containers) Commented Feb 19, 2021 at 17:06
  • The original question was why the sort order differs between Py2 and Py3. I completely rephrased the question to reflect that the difference comes from the underlying OS. Commented Feb 23, 2021 at 18:07
  • It looks like CentOS uses an accent-insensitive collation while Ubuntu is accent-sensitive. Commented Feb 23, 2021 at 18:24
  • Shouldn't the locale setting determine whether the collation is accent sensitive or not? Commented Feb 23, 2021 at 20:16

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.