-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add iso-2022-jp fatal encoder #36
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
base: main
Are you sure you want to change the base?
Conversation
1cc7717 to
2e19abb
Compare
2e19abb to
d11aa2f
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 PR implements the iso-2022-jp fatal encoder, completing support for all encoding formats in the Web Platform Tests. The encoder uses a state machine to manage transitions between ASCII, Roman, and JIS0208 character sets via escape sequences.
Changes:
- Added iso-2022-jp encoder implementation with state machine logic for character set transitions
- Removed iso-2022-jp exclusions from WPT test loader
- Added preencoder formula for iso-2022-jp pointer-to-bytes conversion
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/wpt/loader.cjs | Removed iso-2022-jp special case exclusions from encoder tests, enabling validation of the new encoder implementation |
| fallback/multi-byte.js | Added complete iso-2022-jp encoder with state machine (ASCII/Roman/jis0208 states), escape sequence management, halfwidth katakana mapping, and special character handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0a6149e to
cde11eb
Compare
cde11eb to
52571f9
Compare
52571f9 to
c3e38cb
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Passes on all test data in WPT
But that tests only single-codepoint encode, we need to test more, as iso-2022-jp maintains state
Also need to test failures