Function makeLocaleName

Make locale name based on language, country, encoding and modifier.

String makeLocaleName(String) (
  String lang,
  String country = null,
  String encoding = null,
  String modifier = null
) pure @safe
if (isSomeString!String && is(ElementEncodingType!String : char));

Returns

locale name in form lang_COUNTRY.ENCODING@MODIFIER

See Also

parseLocaleName

Example

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

assert(makeLocaleName("ru".dup, (char[]).init, (char[]).init, "mod".dup) == "ru@mod".dup);