Suppose that we have a font with a fixed encoding and want to change mapping between input characters and font slots. How to configure luatex so that if we type A we get B, not changing the font? An example input file follows.
\font\tenrm=cmr10 \tenrm
A
\bye
In the output document we need to get B:
$ luatex test.tex
NOTE: only luatex solution is needed (not lualatex)
return string.gsub(buf,"A", "\u{1071}")into\directluathen it needs to bereturn string.gsub(buf,"A", "\string\u{1071}")to stop\uexpanding, but if you don't show code, I have to guess. – David Carlisle Oct 07 '15 at 12:27