<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 13, 2019, 6:34 PM Thiago Macieira &lt;<a href="mailto:thiago@macieira.org">thiago@macieira.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Monday, 12 August 2019 19:15:14 PDT Tom Honermann wrote:<br>
&gt; On 8/12/19 4:24 PM, Thiago Macieira wrote:<br>
&gt; &gt; This has broken down in recent decades because Clang and GCC do a<br>
&gt; &gt; pass-through from the source charset to the narrow execution charset. So<br>
&gt; &gt; you can&#39;t get the same for non-ASCII. The following source if encoded in<br>
&gt; &gt; Latin1:<br>
&gt; &gt; <br>
&gt; &gt; char str[] = &quot;é&quot;;<br>
&gt; &gt; <br>
&gt; &gt; will not behave properly under UTF-8 execution charset at runtime. I don&#39;t<br>
&gt; &gt; know if -finput-charset=latin1 makes a difference.<br>
&gt; <br>
&gt; Use of -finput-charset=latin1 does suffice for gcc to DTRT.<br>
&gt; <br>
&gt; It is a little disappointing that no warning is issued, even when<br>
&gt; -finput-charset=utf-8 is specified.<br>
<br>
Right, but on the other hand that&#39;s actually nice, because you can have binary <br>
data in your source code and not get the compiler complaining at you. So long <br>
as you escape NULs, you could probably just dump a binary file in a raw, <br>
narrow-character (byte) string literal.<br>
<br>
(if anyone is thinking about that, I don&#39;t recommend it. You&#39;re going to run <br>
into size limits: ICC at 512kB and MSVC at 256kB. Use something like xxd -i to <br>
generate a brace-delimited array instead)<br></blockquote></div><div><br></div><div>Afaik that works if you use \x to escape every byte otherwise some implementation will mess with your data. Nothing is guaranteed to be passthrough otherwise</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>
-- <br>
Thiago Macieira - thiago (AT) <a href="http://macieira.info" rel="noreferrer" target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" rel="noreferrer" target="_blank">kde.org</a><br>
   Software Architect - Intel System Software Products<br>
<br>
<br>
<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>