[luatex] BOM

Javier Bezos listas at tex-tipografia.com
Fri May 15 09:45:38 CEST 2009

> I could set
>   \catcode "FEFF = 9
> as part of the initex initialization code. That would do the trick, yes?

Yes, provided the source is in uft-8. Actually, the BOM produces 
different arrays of bytes depending on the encoding, and therefore the 
trick doesn't work with, say, utf16 or utf7, except if we first set how
the file should be read -- since the BOM must be the very first thing in 
the file, this means we need to do some kind of preprocessing, which is 
not always desirable or convenient. Of ourse, how the BOM is handled is 
to be determined by the format, but catching it is not easy and very 
likely a callback will be necessary to read the string of bytes at the 
beginning of the file (I presume it's possible).


More information about the luatex mailing list