Skip to content
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

Merged
merged 2 commits into from
Oct 21, 2020

Conversation

annevk
Copy link
Member

@annevk annevk commented Oct 20, 2020

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

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.
@annevk annevk requested a review from hsivonen October 20, 2020 11:51
encoding.bs Outdated Show resolved Hide resolved
@annevk annevk mentioned this pull request Oct 20, 2020
@annevk annevk requested a review from hsivonen October 20, 2020 13:02
Copy link
Member

@hsivonen hsivonen left a 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>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be

Suggested change
<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>,

Copy link
Member Author

@annevk annevk Oct 21, 2020

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.)

Copy link
Member

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.

@annevk annevk merged commit a5e3e11 into master Oct 21, 2020
@annevk annevk deleted the annevk/error-state-switch branch October 21, 2020 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Encode hook not adequate
3 participants