Skip to content

Commit 7f77e7a

Browse files
committed
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 b579018 commit 7f77e7a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: encoding.bs

+9
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,15 @@ consumers of content generated with <a>GBK</a>'s <a for=/>encoder</a>.
26502650

26512651
<h4 id=iso-2022-jp-encoder dfn export>ISO-2022-JP encoder</h4>
26522652

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

0 commit comments

Comments
 (0)