[luatex] Input/output and encoding.
Paul Isambert
zappathustra at free.fr
Sun Aug 1 20:32:13 CEST 2010
Selon Manuel Pégourié-Gonnard <mpg at elzevir.fr>:
> Hi,
>
> Let's try with the following variation of your example:
>
> Le 01/08/2010 18:50, Paul Isambert a écrit :
> > \directlua{%
> > function convert(buf)
> > return string.gsub(buf,"(.)",
> > function (ch) return
> unicode.utf8.char(string.byte(ch))
> > end)
> > end
> > callback.register('process_input_buffer',convert)
> > }
> >
> > \immediate\openout0=\jobname.xxx
> > \immediate\write0{Héhé.}
>
> \immediate\write0{\def\foo{Héhé.}} % instead
>
> > \immediate\closeout0
> >
> > \directlua{callback.register('process_input_buffer',nil)}
> > \input \jobname.xxx
>
> \show\foo % added
>
> > \bye
> >
> Now it looks working.
>
> OTOH, a simple
>
> Héhé.\bye
>
> won't work.
>
> So I think the problem is not at all due to playing with the callbacks, but
> only
> to the default font missing the "é' character.
You're absolutely right, Manuel. I got so entangled in my own code that when I
did the example I forgot CM fonts have no "é" character per se (I'm using
OpenType fonts normally). The truth is, the error was in my code (which isn't
meant to print anything, despite the example I've given). I've fixed it, and
everything works fine now. It took me an hour, although the error was so simple
I'm too ashamed to tell it; on my way I thought I had discovered a bug in eTeX.
Which tells a lot about how tired I am.
Sorry to all for the disturbance. I sometimes post faster than I think.
Best,
Paul
More information about the luatex
mailing list