<div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019, 18:59 Davis Herring via Core &lt;<a href="mailto:core@lists.isocpp.org">core@lists.isocpp.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; u8&quot;é&quot; is ambiguous. Both people and the compiler may interpret that in a<br>
&gt; variety of ways. Notably if I have utf-8 in that file, which I wrote on<br>
&gt; Linux, but then the msvc compiler thinks it&#39;s windows 1252...<br>
&gt; Mojibake.<br>
<br>
We have a recursive example of bytes/characters confusion here.  If you <br>
want to say that the bytes 75 38 22 c3 a9 22 (because you &quot;have utf-8 in <br>
that file&quot;) are ambiguous, of course they are, but so is 5c 41 unless <br>
you restrict to ASCII/Latin-*/UTF-8.  You always have to arrange for <br>
your compiler to know which characters are signified by the bytes in <br>
your source file, and having some of them be non-ASCII doesn&#39;t <br>
fundamentally change anything (even though in practice it makes it harder).<br>
<br>
Your message doesn&#39;t contain those bytes anyway; since it contains a header<br>
<br>
   Content-Type: text/plain; charset=&quot;UTF-8&quot;<br>
<br>
it&#39;s appropriate to say that you wrote 5 (abstract) characters: LATIN <br>
SMALL LETTER U, DIGIT EIGHT, QUOTATION MARK, LATIN SMALL LETTER E WITH <br>
ACUTE, and QUOTATION MARK again.  (Of course, you could also have <br>
written LATIN SMALL LETTER E and COMBINING ACUTE ACCENT; that&#39;s a <br>
different sort of ambiguity.)<br></blockquote></div><div dir="auto"><br></div><div dir="auto"><div dir="auto">It is probably best to avoid the term &quot;character&quot; and derivatives when discussing Unicode since it itself is ambiguous. Those are all codepoints. &quot;LATIN SMALL LETTER E WITH ACUTE&quot; is the same grapheme (aka &quot;user percived character) as &quot;LATIN SMALL LETTER E and COMBINING ACUTE ACCENT&quot;, just represented in a different way. But they should still generally be treated identically regardless of which normal form they are encoded to.</div><div dir="auto"><br></div><div dir="auto">This also avoids an ambiguity where c++ terminology expects a &quot;character&quot; to be a fixed size object, while graphemes are variably-sized in Unicode. Codepoints are fixed size, but they aren&#39;t useful to work with unless you are doing one of the defined Unicode algorithms, so they shouldn&#39;t be emphasized in interfaces for ordinary developers.</div></div><div dir="auto"><br></div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div>