title: How does file encoding affect C++11 string literals?
body: <p>You can write UTF-8/16/32 string literals in C++11 by prefixing the string literal with <code>u8</code>/<code>u</code>/<code>U</code> respectively. How must the compiler interpret a UTF-8 file that has non-ASCII characters inside of these new types of string literals? I understand the standard does not specify file encodings, and that fact alone would make the interpretation of non-ASCII characters inside source code completely undefined behavior, making the feature just a tad less useful.</p>
  
  <p>I understand you can still escape single unicode characters with <code>\uNNNN</code>, but that is not very readable for, say, a full Russian, or French sentence, which typically contain more than one unicode character.</p>
  
  <p>What I understand from various sources is that <code>u</code> should become equivalent to <code>L</code> on current Windows implementations and <code>U</code> on e.g. Linux implementations. So with that in mind, I'm also wondering what the required behavior is for the old string literal modifiers...</p>
  
  <p>For the code-sample monkeys:</p>
  
  <pre><code>string utf8string a = u8"L'hôtel de ville doit être là-bas. Ça c'est un fait!";
  string utf16string b = u"L'hôtel de ville doit être là-bas. Ça c'est un fait!";
  string utf32string c = U"L'hôtel de ville doit être là-bas. Ça c'est un fait!";
  </code></pre>
  
  <p>In an ideal world, all of these strings produce the same content (as in: characters after conversion), but my experience with C++ has taught me that this is most definitely implementation defined and probably only the first will do what I want. </p>