You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Serde JSON gives the error "invalid unicode code point at line 1 column 7", but I would argue that the error is at column 4, not 7.
I think this is caused by one of the *from_utf8 calls, e.g. this:
let raw = matchString::from_utf8(raw){Ok(raw) => raw,Err(_) => returnerror(self,ErrorCode::InvalidUnicodeCodePoint),};
Instead of using the position of the end of of the string, Serde JSON should use start + e.valid_up_to() + 1, similar to this code.
The text was updated successfully, but these errors were encountered:
samuelcolvin
changed the title
Wrong positions for InvalidUnicodeCodePoint caused by str::from_utf8
Wrong positions for InvalidUnicodeCodePoint caused by from_utf8Nov 2, 2023
Given the following example:
Serde JSON gives the error "invalid unicode code point at line 1 column 7", but I would argue that the error is at column 4, not 7.
I think this is caused by one of the
*from_utf8
calls, e.g. this:Instead of using the position of the end of of the string, Serde JSON should use
start + e.valid_up_to() + 1
, similar to this code.The text was updated successfully, but these errors were encountered: