Clarify std/json quirk_allow_backslash_x semantics

This commit is contained in:
Nigel Tao committed 2020-04-08 11:08:01 +10:00
1 parent d83bd8d036
commit df3acfbb21
2 files changed
+15 -3

No files matched your search

+4
View File
@@ -624,6 +624,10 @@ JsonThing::parse_string(TokenStream& ts, TokenStream::Result tsr) {
// program doesn't enable that by default, but if you're copy/pasting
// this JsonThing code and your program does enable that option,
// here's how to handle it.
//
// As per the quirk documentation, there are two options for how to
// interpret a backslash-x: as a byte or as a Unicode code point.
// This implementation chooses as a byte.
wuffs_base__slice_u8 encoded = tsr.src_data;
if (encoded.len & 3) {
return Result(