[luatex] lua-inputenc

Ulrike Fischer news2 at nililand.de
Fri Feb 20 15:24:24 CET 2009


Am Fri, 20 Feb 2009 14:26:30 +0100 schrieb Javier Múgica:

>>if you write something like \protect ü ...
> 
> The \protect doesn't make any difference. The relevant fact is that
> the ü is, in Windows for instance, FC, ie, 11111100, and in a  utf-8
> file that byte is not a syngle unit, so it is not a "Byte" in the
> sense of minimun significant unit.

The \protect is a mean for testing what happens if files written by 
luatex (which are utf8) contains non-ascii chars: 

\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)
}

\documentclass{article}
\usepackage[ansinew]{inputenc}
\begin{document}
\tableofcontents
\section{äöü\protect ä \protect ü}
\end{document}

This doesn't work: The section titel is ok, but the table of 
contents is not. 

This means that you can't process documents which writes external 
files in "verbatim mode" if this files contains non-ascii chars, 
e.g. if you use in beamer the fragile option for a frame, or if you 
use the filecontents-environment.

-- 
Ulrike Fischer 



More information about the luatex mailing list