Question
Is constructing std::locale with an empty string to get the user-preferred native locale a part of the standard? If yes, could you point out a source which explicitly states that?
Problem description
Example from documentation of std::locale has this line:
std::wcout << "User-preferred locale setting is " << std::locale("").name().c_str()
Which hints that creating a locale with an empty string will return a user-preferred native locale. After quick googling, this article also mentions:
The empty string tells setlocale to use the locale specified by the user in the environment.
However, when looking at the documentation for std::locale constructors, there is no mentioning of a special case, when an empty string is provided.
Here's the quote:
3-4) Constructs a copy of the system locale with specified std_name (such as "C", or "POSIX", or "en_US.UTF-8", or "English_US.1251"), if such locale is supported by the operating system. The locale constructed in this manner has a name.