-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add multi-byte encoders except iso-2022-jp #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
513b90b to
f7ffa3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds fatal mode encoders for all supported multi-byte character encodings except iso-2022-jp. The implementation follows the WHATWG encoding specification and includes comprehensive test coverage through WPT tests and custom test cases.
Changes:
- Implemented multi-byte encoders (big5, euc-kr, euc-jp, shift_jis, gbk, gb18030) in fallback/multi-byte.js
- Added public API exports in multi-byte.js and multi-byte.node.js
- Added comprehensive test suite with roundtrip validation and edge case testing
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| fallback/multi-byte.js | Core encoder implementations for all multi-byte encodings with map-based lookups and spec-compliant special case handling |
| multi-byte.js | Public API export for createMultibyteEncoder with fatal mode support |
| multi-byte.node.js | Node.js-specific API export matching the base implementation |
| fallback/multi-byte.table.js | Added comment clarifying that low pointer entries are excluded from encoding |
| tests/multi-byte.encode.test.js | Comprehensive test suite covering ASCII supersets, encoding-specific behaviors, and roundtrip validation |
| tests/wpt/loader.cjs | Integrated encoder testing into WPT test loader with appropriate exclusions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f7ffa3a to
5833bd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
93d1287 to
c1984a9
Compare
116ac57 to
dab4901
Compare
dab4901 to
bb14687
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cdf4c38 to
d0226f4
Compare
d0226f4 to
3e803c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add fatal encoders for all supported multi-byte encodings except iso-2022-jp
Ref: #9
iso-2022-jpis not covered by single-char tests as it maintains complex state, so we need better tests for itBundle size increase is negligible