title: Creating an std::locale with an empty string ""
body: <h3>Question</h3>
  
  <p>Is constructing <code>std::locale</code> 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?</p>
  
  <h3>Problem description</h3>
  
  <p>Example from documentation of <a href="http://en.cppreference.com/w/cpp/locale/locale" rel="noreferrer"><code>std::locale</code></a> has this line:</p>
  
  <pre><code>std::wcout &lt;&lt; "User-preferred locale setting is " &lt;&lt; std::locale("").name().c_str()
  </code></pre>
  
  <p>Which hints that creating a locale with an empty string will return a user-preferred native locale. After quick googling, this <a href="http://stdcxx.apache.org/doc/stdlibug/24-3.html" rel="noreferrer">article</a> also mentions:</p>
  
  <blockquote>
    <p>The empty string tells setlocale to use the locale specified by the
    user in the environment.</p>
  </blockquote>
  
  <p>However, when looking at the <a href="http://en.cppreference.com/w/cpp/locale/locale/locale" rel="noreferrer">documentation</a> for <code>std::locale</code> constructors, there is no mentioning of a special case, when an empty string is provided. </p>
  
  <p>Here's the quote:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>