Function parseLocaleName

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

auto auto parseLocaleName(String) (
  String locale
) pure nothrow @nogc @trusted
if (isSomeString!String && is(ElementEncodingType!String : char));

Returns

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

See Also

makeLocaleName

Example

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));

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