I found that the sort result in ASCII:
1- 11- 1-a 11-a
Sort using ASCII:
$ LANG=en_US.ascii sort test 1- 1-a 11- 11-a
And using UTF-8:
$ LANG=en_US.utf8 sort test 1- 11- 11-a 1-a
I feel it's so counter-intuitive, and it's not dictionary order.
Isn't the character '-' (
002d) is always less then
What's the general rule in UTF-8 collation?
And how to bypass it, just make
- be less then
[0-9] while keep other characters unchanged for UTF-8, in Linux? (So it can affects the result of
sort, etc. )