8000 Replace unpaired UTF-16 surrogates in the browser encoder by Aschenbath · Pull Request #160 · kawanet/msgpack-lite · GitHub
[go: up one dir, main page]

Skip to content

Replace unpaired UTF-16 surrogates in the browser encoder - #160

Open
Aschenbath wants to merge 2 commits into
kawanet:mainfrom
Aschenbath:fix/oss30-20261124-9130-msgpack-surrogates
Open

Aschenbath wants to merge 2 commits into
kawanet:mainfrom
Aschenbath:fix/oss30-20261124-9130-msgpack-surrogates

Conversation

@Aschenbath
@Aschenbath Aschenbath commented Nov 24, 2026 •
Copy link
Copy Markdown
Contributor

Uint8Array encoding now replaces unpaired UTF-16 surrogates with U+FFFD without consuming the following character. Valid surrogate pairs still encode as four-byte UTF-8. Tests check explicit normalized strings and encoded bytes for leading, trailing, repeated, and valid surrogate cases.

Validation: the final regression fails on the original implementation. All 204 Node source tests and 190 Chromium browser tests pass on Node 24 / Windows. JSHint, the minified bundle size limit, and browser/CommonJS export smoke checks also pass.

This branch has not been deployed

No deployments
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.

1 participant

0