uutils / uutils/coreutils

sort -k doesn't handle locale

Open
#3,123 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

J - Locale U - sort
Dominant language
Rust
Stars
24.1k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
365

Description

With bash

$ LC_ALL=fr_FR.UTF-8 locale abmon 2>/dev/null |
        tr ';' '\n'|shuf| nl| LC_ALL=fr_FR.UTF-8 sort -k2,2M
     8	janv.
     5	févr.
    12	mars
     2	avril
    11	mai
    10	juin
     4	juil.
     6	août
     3	sept.
     7	oct.
     9	nov.
     1	déc.

with rut/coreutils:

LC_ALL=fr_FR.UTF-8 locale abmon 2>/dev/null |
        tr ';' '\n'|shuf| nl| LC_ALL=fr_FR.UTF-8 ./target/debug/coreutils sort -k2,2M
     3	avril
     5	févr.
     6	juin
     8	mai
    10	juil.
    11	déc.
    12	août
     1	janv.
     2	mars
     7	sept.
     4	oct.
     9	nov.

Used in gnu tests/misc/sort-month

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 with the reported LC_ALL=fr_FR.UTF-8 reproduction for the sort command and compare it with GNU behavior. Read the GNU tests/misc/sort-month reference, then trace the sort month-key handling. Done means the Rust implementation orders localized month names like GNU sort under the shown locale.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.