[luatex] Null bite doesn't write to file
Hans Hagen
j.hagen at xs4all.nl
Thu Mar 5 16:08:00 CET 2020
On 3/5/2020 1:07 PM, Phelype Oleinik wrote:
> Hi all,
>
> When writing a null byte to a file, as in `\immediate\write\test{abc^^@def}`,
> the tokens after the null byte are not written (because of C's \0 string
> termination, I suppose?). The code:
>
> \newwrite\test
> \immediate\openout\test=testfile.tex
> \catcode`\^^@=12
> \immediate\write\test{abc def}
> \immediate\write\test{abc^^@def}
> \closeout\test
> \bye
>
> when run with LuaTeX produces testfile.tex with:
>
> abc def
> abc
>
> whereas pdfTeX and XeTeX it produces:
>
> abc def
> abc^^@def
>
> (or something like that, depending on the -8bit flag).
>
> Is it a bug? Can it be reasonably fixed?
it's more a side effect of luatex being a mix that uses c strings in
many places (and some internals can optionally go through callbacks)
anyway, i looked at it and can make it work but this change in behaviour
will have to wait till *after* the tex live code freeze (which then
gives folks a year to adapt to it)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
More information about the luatex
mailing list.