[luatex] lua-inputenc

Javier Múgica javier at digi21.eu
Fri Feb 20 14:31:08 CET 2009


Here is the right code the other day I wrote by heart and included
some errors. Just is someones wants to copy-paste it and use it.

\directlua0{
function byte_to_utf8(c)
  local b=string.byte(c)
  if b<128 then
    return c
  end
  if b<192 then
    return string.char(194, b)
  else
    return string.char(195, b-64)
  end
end

callback.register('process_input_buffer',
function(buffer)
  return string.gsub(buffer,"(.)",byte_to_utf8)
end)
}

--Javier A.


More information about the luatex mailing list