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
When encoding some invalid user generated data, we encounter JsonGenerationExceptions with the message Unmatched first part of surrogate pair. This didn't occur when using text serialization.
It seems there's a CBOR option to avoid this exception, CBORGenerator.Feature.LENIENT_UTF_ENCODING, but not one for Smile. It would be great to add this feature.
To reproduce, just try to serialize an invalid string, such as "\uD83D".
The text was updated successfully, but these errors were encountered:
cowtowncoder
changed the title
Smile: Unmatched first part of surrogate pair error during serialization
Add SmileGenerator.Feature.LENIENT_UTF_ENCODING for lenient handling of broken Unicode surrogate pairs on writing
Jun 26, 2021
When encoding some invalid user generated data, we encounter
JsonGenerationException
s with the messageUnmatched first part of surrogate pair
. This didn't occur when using text serialization.It seems there's a CBOR option to avoid this exception,
CBORGenerator.Feature.LENIENT_UTF_ENCODING
, but not one for Smile. It would be great to add this feature.To reproduce, just try to serialize an invalid string, such as
"\uD83D"
.The text was updated successfully, but these errors were encountered: