parseLocaleName

Parse locale name into the tuple of 4 values corresponding to language, country, encoding and modifier

@nogc @trusted pure nothrow
parseLocaleName
(
string locale
)

Return Value

Type: auto

Tuple!(string, "lang", string, "country", string, "encoding", string, "modifier")

Examples

assert(parseLocaleName("ru_RU.UTF-8@mod") == tuple("ru", "RU", "UTF-8", "mod"));
assert(parseLocaleName("ru@mod") == tuple("ru", string.init, string.init, "mod"));
assert(parseLocaleName("ru_RU") == tuple("ru", "RU", string.init, string.init));

See Also

makeLocaleName

Meta