Skip to content

handle invalid utf-16 surrogates on TextDecoder#5673

Merged
anonrig merged 1 commit intomainfrom
yagiz/handle-invalid-surrogates
Dec 17, 2025
Merged

handle invalid utf-16 surrogates on TextDecoder#5673
anonrig merged 1 commit intomainfrom
yagiz/handle-invalid-surrogates

Conversation

@anonrig
Copy link
Copy Markdown
Member

@anonrig anonrig commented Dec 10, 2025

Fixes #5390

Handles invalid utf-16 surrogate pairs and replaces invalid pairs with replacement character if needed. The failing tests are available at https://github.com/web-platform-tests/wpt/blob/master/encoding/textdecoder-utf16-surrogates.any.js

@anonrig anonrig requested review from jasnell and npaun December 10, 2025 21:34
@anonrig anonrig requested review from a team as code owners December 10, 2025 21:34
@anonrig anonrig enabled auto-merge (squash) December 10, 2025 21:40
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 11, 2025

CodSpeed Performance Report

Merging #5673 will not alter performance

Comparing yagiz/handle-invalid-surrogates (8dee6c3) with main (ebdbd36)

Summary

✅ 57 untouched
⏩ 30 skipped1

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@anonrig anonrig force-pushed the yagiz/handle-invalid-surrogates branch from 1265301 to ae0080e Compare December 11, 2025 21:13
@anonrig anonrig force-pushed the yagiz/handle-invalid-surrogates branch from ae0080e to 8dee6c3 Compare December 17, 2025 22:19
@anonrig anonrig merged commit ae5836a into main Dec 17, 2025
21 checks passed
@anonrig anonrig deleted the yagiz/handle-invalid-surrogates branch December 17, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate behaviour of TextDecoder when faced with invalid UTF-16 surrogates

2 participants