[luatex] Odd Lua issue with ^^@

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Mar 28 13:25:26 CEST 2017

Hello all,

Testing with LuaTeX v1.04 (using the W32TeX build in my case) I find an
oddity with the handling of ^^@ (null) at the 'Lua side' (for scripting
some tests). The attached demo document reads

    ....\T1/cmr/m/n/10 ^@
    ....\kern -5.13763 (for accent)

(with null shown Vim-style as ^@). Up to recent LuaTeX builds, a script
such as

    for line in io.lines("test.txt") do
      print(string.gsub(line, string.char(0), "^^" .. string.char(64)))

can read that file and output the expected two lines

    ....\T1/cmr/m/n/10 ^^@
    ....\kern -5.13763 (for accent)

However, with the v1.04 build I get only a single line

    ....\T1/cmr/m/n/10 ....\kern -5.13763 (for accent)

Does anyone know if this is a deliberate change in Lua or if something
else is wrong? Lua normally treats bytes including ^^@ 'equally'.

-------------- next part --------------
....\kern -5.13763 (for accent)
-------------- next part --------------
for line in io.lines("temp.txt") do
  print((string.gsub(line, string.char(0), "^^" .. string.char(64))))

More information about the luatex mailing list