From c57e92c6eeb715f0caa6c4799a7a1e54e49fc62f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 9 Jun 2024 18:21:21 -0400 Subject: Treat out of range unicode characters as errors --- src/n3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/n3.c') diff --git a/src/n3.c b/src/n3.c index 6684fae8..39b00d13 100644 --- a/src/n3.c +++ b/src/n3.c @@ -97,7 +97,7 @@ read_UCHAR(SerdReader* const reader, const Ref dest, uint32_t* const char_code) code); push_bytes(reader, dest, replacement_char, 3); *char_code = 0xFFFD; - return SERD_SUCCESS; + return reader->strict ? SERD_ERR_BAD_SYNTAX : SERD_SUCCESS; } // Build output in buf @@ -325,7 +325,7 @@ read_string_escape(SerdReader* const reader, uint32_t code = 0; if ((st = read_ECHAR(reader, ref, flags)) && (st = read_UCHAR(reader, ref, &code))) { - return r_err(reader, st, "invalid escape '\\%c'\n", peek_byte(reader)); + return r_err(reader, st, "expected string escape sequence\n"); } return st; -- cgit v1.2.1