Skip to content

sort -M Locale Month Parsing Gap #9715

@sylvestre

Description

@sylvestre

Component

sort

Description

uutils' sort -M only hardcodes recognition of English 3-letter months (JAN..DEC) and does not parse month abbreviations according to the LC_TIME/LC_ALL locale; GNU sort parses them using the locale's month table.

Test / Reproduction Steps

(A locale with non-English month abbreviations is required, such as de_DE.UTF-8.):
$ printf 'Mär\nJan\n' | LC_ALL=de_DE.UTF-8 sort -M
$ printf 'Mär\nJan\n' | LC_ALL=de_DE.UTF-8 ./target/release/coreutils sort -M
  • GNU: JAN comes first
  • uutils: JAN comes last

Impact

In non-LC_ALL=C/non-English environments, the -M sorting result is incorrect, and scripts relying on localized month text will fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions