Merge remote-tracking branch 'origin/develop' into claude/issue-5340-restore-unget

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-08-19 22:41:46 +02:00
33 changed files with 470 additions and 95 deletions
@@ -393,8 +393,12 @@ struct wide_string_input_helper<BaseInputAdapter, 4>
}
else
{
// unknown character
utf8_bytes[0] = static_cast<std::char_traits<char>::int_type>(wc);
// A code point above U+10FFFF has no UTF-8 encoding. Passing the
// unit through would narrow it to int, where 0xFFFFFFFF becomes
// char_traits<char>::eof() and would end the input silently, so
// emit a byte that is never valid UTF-8 and let the decoder
// reject it.
utf8_bytes[0] = 0xFF;
utf8_bytes_filled = 1;
}
}