coreutils
coreutils copied to clipboard
ls: ls should ignore special characters when sorting
Setup:
$ touch a
$ touch \"b
$ touch c
GNU's ls sorts the files ignoring the leading ":
$ ls
a '"b' c
uutils' ls sorts them lexicographically:
$ cargo run ls
'"b' a c
The discrepancy seems to arise from the fact that ASCII and UTF-8 have different collation rules.
The "problem" is that uutils ls currently only supports the standard C locale. And so its output corresponds to LC_COLLATE=C ls:
$ ls
a '"b' c
$ LC_COLLATE=C ls
'"b' a c