Do not discard byte that is not \
#1056
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When parsing escaped utf-16 surrogates, they must be in the form
\uHHHH\uLLLL
for high and low surrogates, respectively. If the character following the lastH
is not\
, then the parse is invalid.In that case, do not consume the character that is not
\
. In this implementation, this bug is of no consequence because the invalid parse results in an error that is returned to the caller. However,serde_json_lenient
can optionally replace the invalid character with REPLACEMENT CHARACTER, in which case it is important to account for consumed and unconsumed bytes correctly.This mirrors the fix in
google/serde_json_lenient#12.
This continues to pass all tests. I have not added any new tests since the incorrect behavior has no external effect.