<div dir="ltr"><a href="https://isocpp.org/files/papers/P1859R0.html">https://isocpp.org/files/papers/P1859R0.html</a> is my attempt at disentangling the wording around character sets and encodings. Since the values of literals are self-evidently fixed at translation time, any interpretation that involves changing the values of a literal based on the current locale does not make sense. I believe that the intent of lex.charset/3 was to use the locale specified for the compiler to produce the values of literals when encoding from the internal representation of characters. I&#39;m asking that that be termed &quot;{narrow,wide} literal encoding&quot;, as opposed the the &quot;dynamic encoding&quot; controlled by the conversion facet of the currently set locale. <br><br>The interpretation in the standard seems to vary considerably. Fortunately there is not, I believe, implementation divergence. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 4, 2019 at 9:33 AM Jean-Marc Bourguet &lt;<a href="mailto:jm@bourguet.org">jm@bourguet.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 04.11.2019 09:45, Tom Honermann wrote:<br>
&gt; On 11/4/19 7:18 AM, Howard Hinnant wrote:<br>
&gt;&gt; On Nov 4, 2019, at 12:27 AM, Tom Honermann &lt;<a href="mailto:tom@honermann.net" target="_blank">tom@honermann.net</a>&gt; wrote:<br>
&gt;&gt;&gt; I suggest the following wording: (using terminology from P1859R0)<br>
&gt;&gt;&gt; <br>
&gt;&gt;&gt; If Period​::​type is micro, but the character U+00B5 &lt;del&gt;cannot be <br>
&gt;&gt;&gt; represented in the encoding used&lt;/del&gt;&lt;ins&gt;lacks representation in <br>
&gt;&gt;&gt; the execution character set&lt;/ins&gt; for charT, the unit suffix &quot;us&quot; is <br>
&gt;&gt;&gt; used instead of &quot;μs&quot;.  &lt;ins&gt;If<br>
&gt;&gt;&gt; &quot;μs&quot; is used but the dynamic encoding lacks representation for U+00B5 <br>
&gt;&gt;&gt; and the stream is associated with a terminal or console, or if the <br>
&gt;&gt;&gt; stream is imbued with a std::codecvt facet that lacks conversion <br>
&gt;&gt;&gt; support for the character, then the  result is unspecified.&lt;/ins&gt;<br>
&gt;&gt;&gt; <br>
&gt;&gt; I’ve no objection to an issue, but your proposed wording explicitly <br>
&gt;&gt; involves two things I’m strongly against:<br>
&gt;&gt; <br>
&gt;&gt; 1.  Now the code has to check the locale, for this precision only.<br>
&gt;&gt; <br>
&gt;&gt; 2.  Now the code has different behavior between cout and <br>
&gt;&gt; ostringstream.  And the result of ostringstream is very commonly <br>
&gt;&gt; subsequently sent to cout (ostringstream is a common formatting aid).<br>
&gt;&gt; <br>
&gt;&gt; Imo, the proposed wording is much, much worse than the status-quo and <br>
&gt;&gt; I would vote strongly against it.<br>
&gt; <br>
&gt; No, the wording I proposed doesn&#39;t check for locale.  The execution<br>
&gt; character set is the character set used for string literals and is <br>
&gt; known<br>
&gt; at compile time; it is not the locale dependent run-time character set.<br>
<br>
lex.charset/3 states<br>
<br>
     The values of the members of the execution character sets and the <br>
sets of additional members are locale-specific.<br>
<br>
apparently making the execution character sets run-time dependent.<br>
<br>
But lex.ccon/2 states<br>
<br>
     An ordinary character literal that contains a single c-char <br>
representable in the execution character set has type char, with value <br>
equal to the numerical value of the encoding of the c-char in the <br>
execution character set.<br>
<br>
apparently making it fixed.<br>
<br>
I&#39;ve not looked at that more in-depth to see which interpretation is the <br>
more pervasive.<br>
<br>
Yours,<br>
<br>
-- Jean-Marc Bourguet<br>
_______________________________________________<br>
SG16 Unicode mailing list<br>
<a href="mailto:Unicode@isocpp.open-std.org" target="_blank">Unicode@isocpp.open-std.org</a><br>
<a href="http://www.open-std.org/mailman/listinfo/unicode" rel="noreferrer" target="_blank">http://www.open-std.org/mailman/listinfo/unicode</a><br>
</blockquote></div>