Normalize native XeTeX physical input before tokenization

This commit is contained in:
gloamxun committed 2026-11-26 13:02:38 +08:00
1 parent 048478c346
commit 76df2d6832
10 files changed
+214 -63

No files matched your search

@@ -2860,11 +2860,9 @@ impl Executor {
let chars: Vec<xe_encoding::Character> = if let Some(encoding) = &encoding {
let (resolved, bom) = encoding.resolve(&line);
let (length, _) = resolved.framing().line_boundary(&line[bom..]);
let (mut chars, warnings) = resolved.decode(&line[bom..bom + length], base + bom)
let (chars, warnings) = resolved
.decode_line(&line[bom..bom + length], base + bom, &self.state, &mut self.reads)
.map_err(|e| self.error(e, Span { source, start: base + bom, end }))?;
while chars.last().is_some_and(|c| matches!(c.value, ' ' | '\r' | '\n')) {
chars.pop();
}
if warnings > 0 {
self.observe_xe_utf8_warnings(
vec![(self.input_position.map_or(1, |(_, line)| line), warnings)],