-
Notifications
You must be signed in to change notification settings - Fork 77
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
Editorial: make ISO-2022-JP encoder perform error state switch #236
Conversation
This way you can invoke its handler directly without going the process algorithm as is needed to fix #235. This also avoids the need for "prepend" in the "process" algorithm. Additionally, this commit adds two clarifying asserts to the "process" algorithm documenting what error modes can be in effect when.
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.
Thanks.
<p>If <var>pointer</var> is null, then: | ||
|
||
<ol> | ||
<li><p>If <a>ISO-2022-JP encoder state</a> is <a lt="ISO-2022-JP encoder jis0208">jis0208</a>, |
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.
Shouldn't this be
<li><p>If <a>ISO-2022-JP encoder state</a> is <a lt="ISO-2022-JP encoder jis0208">jis0208</a>, | |
<li><p>If <a>ISO-2022-JP encoder state</a> is not <a lt="ISO-2022-JP encoder ASCII">ASCII</a>, |
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.
We don't do a state switch earlier when it's an error and Roman and I don't see why we should here. I should probably write some tests to ensure implementations do the right thing though. (Edit: whatever these tests end up showing though I don't want to make changes in this PR as this should just be editorial and making this suggested change would be a normative change.)
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.
Please document (for non-browser users of the spec) that callers of the abstraction are responsible for emitting a replacement byte sequence that only uses the bytes that have the ASCII interpretation in the Roman state of ISO-2022-JP.
This way you can invoke its handler directly without going the process algorithm as is needed to fix #235. This also avoids the need for "prepend" in the "process" algorithm.
Additionally, this commit adds two clarifying asserts to the "process" algorithm documenting what error modes can be in effect when.
Preview | Diff