mirror of
https://github.com/nlohmann/json.git
synced 2026-09-29 11:10:30 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user