ls: ignore capitalization while sorting#5330
Conversation
ThomasFrans
commented
Sep 27, 2023
- Ignore capitalization when sorting entries, just like the GNU version does.
- Ignore capitalization when sorting entries, just like the GNU version does.
|
There seems to have been a regression regarding the default sorting of the |
|
Hi! Thanks for contributing! Unfortunately, this issue is not that easy to solve. GNU's sorting is based on locale. So if you change your locale, the order changes. In the Unicode standard, this is called collation. We don't have that implemented (yet!), so for now, we match the "C" locale. You can try this out yourself. This should give you the same order with both GNU and uutils: So, it's the collation that makes the sorting case-insensitive. To implement this correctly, without breaking the C locale, we need to support multiple locales, which is a big project (but definitely something we want to do). The issue for localization is here: #3997 See also previous attempts at this:
If you want to avoid this kind of situation in the future, please open an issue before making a change, so we can help out! |
|
Ah OK, thought it was an easy fix that just went unnoticed. Didn't know those PRs and issues were related. Also the PR was wrong anyway as is. Will close this 🙂 |
|
I understand, you're not the first who thought that, myself included a few years back 😄 Thanks anyway! |