Skip to content

Read escaped surrogate pairs in JSON strings - #412

Merged
agocke merged 3 commits into
mainfrom
copilot/fix-json-deserializer-escaped-surrogate-pairs
Oct 4, 2026
Merged

agocke merged 3 commits into
mainfrom
copilot/fix-json-deserializer-escaped-surrogate-pairs

Conversation

Copilot AI commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Serde can deserialize unescaped emoji but rejects their \u-escaped surrogate-pair form, including output from its own JSON serializer.

  • Decoder: Correct the low-surrogate offsets and preserve index handling in the legacy unescaping path.
  • Regression coverage: Add escaped-input and serialize/deserialize round trips for generated records and JsonValue.

For example, {"text":"\uD83E\uDD16"} should deserialize with text set to 🤖.

Copilot AI and others added 2 commits October 4, 2026 06:46
Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix JSON deserializer for escaped surrogate pairs Read escaped surrogate pairs in JSON strings Oct 4, 2026
Copilot AI requested a review from agocke October 4, 2026 06:50
@agocke
agocke marked this pull request as ready for review October 4, 2026 16:43
@agocke
agocke merged commit 0385bb8 into main Oct 4, 2026
2 checks passed
@agocke
agocke deleted the copilot/fix-json-deserializer-escaped-surrogate-pairs branch October 4, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON deserializer can't read escaped surrogate pairs, including Serde's own output for emoji

2 participants