[luatex] questions about the "reader" in open_read_file callback

Ulrike Fischer luatex at nililand.de
Tue Nov 16 15:48:08 CET 2010

I'm trying to write some code to handle the input of 8-bit-encoded
files. I'm using the ideas I found in an old posting

In short with the open_read_file callback I open the file, scan the
first lines for an encoding setting (e.g. %encoding=ansinew) and
then change the reader so that it converts the ansinew to utf8.

To my suprise my code even worked in this setup

äöü %read as ansinew

\input{utf8-file} %read as utf8

äöü %read again in ansinew

1. Does that mean that each file has its own "reader" instance? Or
is there some scoping involved? 

2. Currently my code affects only files input later. How could I
change the processing of (only) the main document? 

Ulrike Fischer 

More information about the luatex mailing list