Skip to content

Commit

Permalink
Add range checks to shift_jis EUDC handling and ack last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed May 12, 2014
1 parent 55accc7 commit 236196e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
19 changes: 12 additions & 7 deletions Overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<p><a class="logo" href="//www.whatwg.org/"><img alt="WHATWG" height="100" src="//resources.whatwg.org/logo-encoding.svg" width="100"></a></p>
<h1>Encoding</h1>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-28-april-2014">Living Standard — Last Updated 28 April 2014</h2>
<h2 class="no-num no-toc" id="living-standard-—-last-updated-12-may-2014">Living Standard — Last Updated 12 May 2014</h2>

<dl>
<dt>This Version:
Expand Down Expand Up @@ -36,7 +36,7 @@ <h2 class="no-num no-toc" id="living-standard-—-last-updated-28-april-2014">Li
<p class="copyright"><a href="http://creativecommons.org/publicdomain/zero/1.0/" rel="license">CC0 1.0 Universal</a>.
To the extent possible under law, the editor has waived all copyright and
related or neighboring rights to this work. In addition, as of
28 April 2014, the editor has made this specification available
12 May 2014, the editor has made this specification available
under the
<a href="http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0" rel="license">Open Web Foundation Agreement Version 1.0</a>,
which is available at
Expand Down Expand Up @@ -2353,11 +2353,6 @@ <h4 id="shift_jis-decoder"><span class="secno">12.3.1 </span><dfn>shift_jis deco
<li><p>Let <var>offset</var> be 0x40, if <var title="">byte</var> is
less than 0x7F, and 0x41 otherwise.

<li><p>If <var>lead</var> is in the range 0xF0 to 0xF9, return
a code point whose value is
0xE000 + (<var>lead</var> − 0xF0) × 188 + <var title="">byte</var><var>offset</var>.
<!-- EUDC / PUA -->

<li><p>Let <var>lead offset</var> be 0x81, if <var>lead</var>
is less than 0xA0, and 0xC1 otherwise.

Expand All @@ -2369,6 +2364,14 @@ <h4 id="shift_jis-decoder"><span class="secno">12.3.1 </span><dfn>shift_jis deco
<var title="">pointer</var> is null, and the <a href="#index-code-point">index code point</a>
for <var title="">pointer</var> in <a href="#index-jis0208">index jis0208</a> otherwise.

<li>
<p>If <var title="">code point</var> is null and <var>pointer</var> is in the range
8836 to 10528, return a code point whose value is
0xE000 + <var>pointer</var> − 8836.

<p class="note">This is interoperable legacy from Windows known as EUDC.
<!-- PUA -->

<li><p>If <var title="">pointer</var> is null,
<a href="#concept-stream-prepend" title="concept-stream-prepend">prepend</a> <var title="">byte</var> to
<var>stream</var>.
Expand Down Expand Up @@ -2834,6 +2837,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
<p>With that, many thanks to

Alan Chaney,
Alexander Shtuchkin,
Allen Wirfs-Brock,
Ben Noordhuis,
Boris Zbarsky,
Expand All @@ -2852,6 +2856,7 @@ <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
John Tamplin,
Joshua Bell,
신정식 (Jungshik Shin),
강 성훈 (Kang Seonghoon),
川幡太一 (Kawabata Taichi),
Ken Lunde,
Kenneth Russell,
Expand Down
15 changes: 10 additions & 5 deletions Overview.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -2270,11 +2270,6 @@ <h4><dfn>shift_jis decoder</dfn></h4>
<li><p>Let <var>offset</var> be 0x40, if <var title>byte</var> is
less than 0x7F, and 0x41 otherwise.

<li><p>If <var>lead</var> is in the range 0xF0 to 0xF9, return
a code point whose value is
0xE000 + (<var>lead</var> &minus; 0xF0) &times; 188 + <var title>byte</var> &minus; <var>offset</var>.
<!-- EUDC / PUA -->

<li><p>Let <var>lead offset</var> be 0x81, if <var>lead</var>
is less than 0xA0, and 0xC1 otherwise.

Expand All @@ -2286,6 +2281,14 @@ <h4><dfn>shift_jis decoder</dfn></h4>
<var title>pointer</var> is null, and the <span>index code point</span>
for <var title>pointer</var> in <span>index jis0208</span> otherwise.

<li>
<p>If <var title>code point</var> is null and <var>pointer</var> is in the range
8836 to 10528, return a code point whose value is
0xE000 + <var>pointer</var> &minus; 8836.

<p class=note>This is interoperable legacy from Windows known as EUDC.
<!-- PUA -->

<li><p>If <var title>pointer</var> is null,
<span title=concept-stream-prepend>prepend</span> <var title>byte</var> to
<var>stream</var>.
Expand Down Expand Up @@ -2727,6 +2730,7 @@ <h2 class=no-num>Acknowledgments</h2>
<p>With that, many thanks to

Alan Chaney,
Alexander Shtuchkin,
Allen Wirfs-Brock,
Ben Noordhuis,
Boris Zbarsky,
Expand All @@ -2745,6 +2749,7 @@ <h2 class=no-num>Acknowledgments</h2>
John Tamplin,
Joshua Bell,
신정식 (Jungshik Shin),
강 성훈 (Kang Seonghoon),
川幡太一 (Kawabata Taichi),
Ken Lunde,
Kenneth Russell,
Expand Down

0 comments on commit 236196e

Please sign in to comment.