<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 13 Jan 2023 at 22:36, Vítek Novotný <<a href="mailto:witiko@mail.muni.cz">witiko@mail.muni.cz</a>> 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">Dear LuaTeX developers,<br>
<br>
assume the following plain TeX document `example.tex`:<br>
<br>
\newwrite\outfile<br>
\openout\outfile\jobname.out<br>
\write\outfile{^^^^fffd}<br>
\closeout\outfile<br>
\bye<br>
<br>
Running `luatex example` will correctly produce file `example.out` with the<br>
UTF-8 encoding of U+FFFD: 0xEF, 0xBF, and 0xBD.<br>
<br>
$ hexdump -C<br>
00000000 ef bf bd 0a |....|<br>
00000004<br>
<br>
Now, let's change `example.tex` as follows:<br>
<br>
\input\jobname.out<br>
\bye<br>
<br>
Running `luatex example` produces the following error:<br>
<br>
! String contains an invalid utf-8 sequence.<br>
<br>
I would expect that LuaTeX would treat ^^^^fffd and the byte sequence 0xEF,<br>
0xBF, and 0xBD the same. This issue was co-discovered by @lostenderman at<br>
<<a href="https://github.com/lostenderman/markdown/issues/34" rel="noreferrer" target="_blank">https://github.com/lostenderman/markdown/issues/34</a>>.<br>
<br></blockquote><div><br></div><div>hm, checking it now.</div><div><br></div><div>--</div><div>luigi</div></div></div>