Files
Library/include
faumarayandClaude Opus 4.8 0b3505e00f Json: decode \u UTF-16 surrogate pairs to valid UTF-8
The \uXXXX unescaper encoded each 16-bit unit independently, so an astral
character written as a surrogate pair (e.g. an emoji, 🎸) became two
separately-encoded surrogates — invalid UTF-8 (ED A0 BC ED BE B8) that renders
as replacement characters. Consumers that validate UTF-8 (e.g. TeamSpeak)
reject any string containing it, which silently dropped every bot reply that
embedded an emoji-bearing YouTube title.

Combine a high surrogate (D800-DBFF) with the following low surrogate
(DC00-DFFF) into one code point and emit proper 4-byte UTF-8; a lone surrogate
still falls through as before.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 02:39:10 +03:00
..