Skip to content

factor out POSIX locale-str parsing #12291

@Rudxain

Description

@Rudxain

I've noticed code duplication w.r.t. locale env-vars (LANG, LC_*), and one instance of a bug caused by improper parsing

This function seems to work properly, but because POSIX isn't very clear, it might be incorrect as it matches the POSIX/C locale against the full string, instead of splitting on ".".

This fn is very similar to the previous one.

Then there's this other fn which performs full locale parsing, but seems to incorrectly handle malformed strings such as en_us@utf-8.dict

I was considering to implement a new crate for locale parsing, as I couldn't find one on crates.io. This way, uutils and other projects could benefit from consistent parsing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions