fn parse_locale_code(code: &str) -> Option<String> { // Some locales are returned with the char encoding too: `en_US.UTF-8` // TODO: Once we bump MSRV >= 1.52, remove this allow and clean up #[allow(clippy::manual_split_once)] #[allow(clippy::needless_splitn)]
code.splitn(2, '.').next().map(|s| s.replace('_', "-"))
}
#[cfg(test)] mod tests { usesuper::{parse_locale_code, EnvAccess, _get, LANG, LC_ALL, LC_CTYPE}; use std::{
collections::HashMap,
ffi::{OsStr, OsString},
};
// These locale names are technically allowed and some systems may still // defined aliases such as these but the glibc sources mention that this // should be considered deprecated
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.