The standard is pretty much silent on what constitutes a valid locale name; only that passing an invalid locale name results in
std::runtime_error. What locale names are usable on common windows compilers such as MSVC, MinGW, and ICC?
locale "lang[_country_region[.code_page]]" | ".code_page" | "" | NULL
Although my answers covers
setlocale instead of
std::locale, this MSDN page seems to imply that the format is indeed the same :
An object of class locale also stores a locale name as an object of class string. Using an invalid locale name to construct a locale facet or a locale object throws an object of class
runtime_error. The stored locale name is "*" if the locale object cannot be certain that a C-style locale corresponds exactly to that represented by the object. Otherwise, you can establish a matching locale within the Standard C Library, for the locale object loc, by calling