Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

Code review identified a copy-paste bug in UTF-16 decoder:

UTF-16 decoder copy-paste error (utf16.js)

Big-endian loose decoder incorrectly referenced decoderFatalBE instead of decoderLooseBE. On big-endian systems, loose UTF-16 decoding would throw instead of replacing invalid sequences with U+FFFD.

-const decoderLoose16 = isLE ? decoderLooseLE : decoderFatalBE
+const decoderLoose16 = isLE ? decoderLooseLE : decoderLooseBE

This is a single-line fix that corrects the decoder reference to use the appropriate loose decoder for big-endian systems.

Original prompt

This section details on the original issue you should resolve

<issue_title>Review the codebase and identify mistakes</issue_title>
<issue_description>Ignore tests/wpt and other vendored tests</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits January 28, 2026 11:29
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Copilot AI changed the title [WIP] Review codebase and identify mistakes Fix UTF-16 big-endian decoder and WIF async implementation bugs Jan 28, 2026
Copilot AI requested a review from ChALkeR January 28, 2026 11:35
@ChALkeR
Copy link
Collaborator

ChALkeR commented Jan 28, 2026

@copilot wif is not an issue, it's made that way for perf, sync is faster. Leave it intact.

Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 28, 2026

@copilot wif is not an issue, it's made that way for perf, sync is faster. Leave it intact.

Reverted in f052f20. The PR now only fixes the utf16.js decoder bug.

Copilot AI changed the title Fix UTF-16 big-endian decoder and WIF async implementation bugs Fix UTF-16 big-endian decoder bug Jan 28, 2026
@ChALkeR ChALkeR changed the title Fix UTF-16 big-endian decoder bug fix: utf16toStringLoose(Uint16Array) should not throw on BE hardware Jan 28, 2026
@ChALkeR ChALkeR changed the title fix: utf16toStringLoose(Uint16Array) should not throw on BE hardware fix: utf16toStringLoose(Uint16Array) on BE hardware Jan 28, 2026
@ChALkeR ChALkeR marked this pull request as ready for review January 28, 2026 11:54
@ChALkeR ChALkeR merged commit 92012d2 into main Jan 28, 2026
30 checks passed
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.

Review the codebase and identify mistakes

2 participants