<div dir="auto">That literals aren&#39;t required to be well formed is a subset of the problem that char8_t data may have come from anywhere and can&#39;t be assumed to be well formed. Real world text is frequently broken. <div dir="auto"> <div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2019, 06:27 JeanHeyd Meneide &lt;<a href="mailto:phdofthehouse@gmail.com">phdofthehouse@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">On Tue, Jun 4, 2019 at 5:39 AM Lyberta &lt;<a href="mailto:lyberta@lyberta.net" target="_blank" rel="noreferrer">lyberta@lyberta.net</a>&gt; wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We can always modify the standard so that we get strong types via<br>
compiler magic. I was thinking:<br>
<br>
utf8&#39;a&#39; -&gt; std::unicode::utf8_code_unit<br>
utf16&#39;a&#39; -&gt; std::unicode::utf16_code_unit<br>
utf32&#39;a&#39; -&gt; std::unicode::utf32_code_unit<br>
utf8&quot;a&quot; -&gt; std::unicode::utf8_code_unit_sequence_view<br>
utf16&quot;a&quot; -&gt; std::unicode::utf16_code_unit_sequence_view<br>
utf32&quot;a&quot; -&gt; std::unicode::utf32_code_unit_sequence_view<br>
<br>
Well, that&#39;s future. I want something I can use now.<br>
<br>
Also, does the standard require well formed sequences in literals?<br></blockquote><div><br></div><div>
No, we lobbied specifically that you can insert &quot;ill-formed&quot; sequences 
(e.g., not perfectly well formed Unicode Scalar Values) into string 
literals. This is specifically to enable people who need literals of 
types that are not exactly conformant for various reasons (testing, or 
specifically creating WTF8/CESU8/etc. literals, and more). <br><br></div><div>Granted, the only way you can do this is by writing `\x` values specifically in the string literal: it&#39;s a very powerful show that someone is doing something non-standard. That doesn&#39;t mean you can&#39;t assume char8_t, char16_t, and char32_t are not well-formed: if someone&#39;s shoving in direct code unit values with backslash-X syntax, you have to assume they are a Very Smart Person Who Knows What They Are Getting Themselves Into.<br></div></div></div>
_______________________________________________<br>
SG16 Unicode mailing list<br>
<a href="mailto:Unicode@isocpp.open-std.org" target="_blank" rel="noreferrer">Unicode@isocpp.open-std.org</a><br>
<a href="http://www.open-std.org/mailman/listinfo/unicode" rel="noreferrer noreferrer" target="_blank">http://www.open-std.org/mailman/listinfo/unicode</a><br>
</blockquote></div>