Hi,
I think that the get_next() routine is mistakenly applying a UTF16 decoding step that is not necessary. Start at line 8442 of xetex.web ("Input from external file, |goto restart| if no input found"), there is a UTF16 decoding stage. But "cur_chr" and "buffer" are UnicodeScalars and are already 32-bit.
Reported as part of the Rust "oxidation" of the Tectonic project:
Anonymous