ls should honor LC_CTYTPE
Open
Nobody has claimed this yet.
U - ls
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
ls should honor LC_CTYPE when using UTF-8.
With a correct LC_CTYPE locale, ls output is corrupted:
> echo $LC_CTYPE # no other locale specific variable
fr_FR.UTF-8
> touch aéa # é = 0xc3 0xa9
> ls
a??a
Instead, ls wrongly uses the LC_COLLATE variable:
> LC_COLLATE=fr_FR.UTF-8 ls
aéa
So, in order to display file names (and may be other informations), ls should use the LC_CTYPE locale and not LC_COLLATE (as with GNU coreutils).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the UTF-8 filename example with ls, LC_CTYPE=fr_FR.UTF-8, and LC_COLLATE=fr_FR.UTF-8, then trace the ls locale handling. Done means filenames display correctly when only LC_CTYPE is set and no longer depend on LC_COLLATE.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100