[luatex] string.char

Paul Isambert zappathustra at free.fr
Tue Apr 5 11:31:50 CEST 2011

Le 05/04/2011 10:49, Taco Hoekwater a écrit :
> On 04/04/2011 10:01 PM, Paul Isambert wrote:
>>> \directlua{tex.settoks(0, "A\string\000B")}
>>> has the wrong result "A^^@^^X", thus I conclude that
>>> tex.settoks might be the problem.
>> So it seems you've found yourself a nice bug to report :)
>> I say so because I don't think Taco is reading the list much these
>> times, so a tracker item would be safer.
> I actually do read the list, but usually have no time to reply these
> days.
> In this case, the problem is indeed the settoks as that used
> strdup() to get the needed memory (and therefore stops at the
> first \000). There was a simple fix, so I have applied something
> immediately. If you can, please try rev. 4096.

It works very well: tested with tex.settoks(0, string.char(65, 0, 66) 
and tex.settoks(0, "A\string\000B"), both return "A^^@B".

More information about the luatex mailing list