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
I've noticed code duplication w.r.t. locale env-vars (
LANG,LC_*), and one instance of a bug caused by improper parsingThis 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.dictI was considering to implement a new crate for locale parsing, as I couldn't find one on
crates.io. This way,uutilsand other projects could benefit from consistent parsing