Skip to content

Commit fe4934c

Browse files
authored
ISO-2022-JP encoder: document an oddity
At this point it does not seem worth it to require further implementation changes and risk compatibility issues, so instead document the quirk. Closes #115.
1 parent 42100c8 commit fe4934c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: encoding.bs

+10
Original file line numberDiff line numberDiff line change
@@ -2652,6 +2652,16 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
26522652

26532653
<h4 id=iso-2022-jp-encoder dfn export>ISO-2022-JP encoder</h4>
26542654

2655+
<div class="note no-backref">
2656+
<p>The <a>ISO-2022-JP encoder</a> is the only <a for=/>encoder</a> for which the concatenation of
2657+
multiple outputs can result in an <a>error</a> when run through the corresponding
2658+
<a for=/>decoder</a>.
2659+
2660+
<p class=example id=example-iso-2022-jp-encoder-oddity>Encoding U+00A5 gives 0x1B 0x28 0x4A 0x5C
2661+
0x1B 0x28 0x42. Doing that twice, concatenating the results, and then decoding yields U+00A5 U+FFFD
2662+
U+00A5.
2663+
</div>
2664+
26552665
<p><a>ISO-2022-JP</a>'s <a for=/>encoder</a> has an associated
26562666
<dfn>ISO-2022-JP encoder state</dfn> which is <dfn lt="ISO-2022-JP encoder ASCII">ASCII</dfn>,
26572667
<dfn lt="ISO-2022-JP encoder Roman">Roman</dfn>, or

0 commit comments

Comments
 (0)