uutils / uutils/coreutils

ls should honor LC_CTYTPE

Open
#9,285 1 comment 3 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.