<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>26885</bug_id>
          
          <creation_ts>2014-09-22 17:35:26 +0000</creation_ts>
          <short_desc>Drop JIS X 212 from ISO-2022-JP</short_desc>
          <delta_ts>2014-11-04 14:22:33 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>Encoding</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jungshik Shin">jshin</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>hsivonen</cc>
    
    <cc>jsbell</cc>
    
    <cc>mike</cc>
    
    <cc>pub-w3</cc>
    
    <cc>smontagu</cc>
    
    <cc>travil</cc>
    
    <cc>VYV03354</cc>
    
    <cc>www-international</cc>
          
          <qa_contact>sideshowbarker+encodingspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>111937</commentid>
    <comment_count>0</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2014-09-22 17:35:26 +0000</bug_when>
    <thetext>EUC-JP in the encoding spec does not support JIS X 212 even though the formal definition of EUC-JP does include it. 

OTOH, ISO-2022-JP in the encoding spec does support JIS X 212 to my surprise. 

 Is there a reason to support JIS X 212 in ISO-2022-JP? It&apos;s not a part of the original ISO-2022-JP (RFC 1468 : https://www.ietf.org/rfc/rfc1468.txt). It&apos;s added later in RFC 1554, but I don&apos;t think it&apos;s widely used. 

Blink has never supported ISO-2022-JP-2 with JIS X 212. It only supports the original ISO-2022-JP.  Supporting JIS X 212 adds ~ 50kB to our build and I&apos;d rather avoid it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111965</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-09-22 18:05:32 +0000</bug_when>
    <thetext>Per bug 19939 comment 5 IE probably does not support this either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111994</commentid>
    <comment_count>2</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2014-09-23 00:46:26 +0000</bug_when>
    <thetext>(In reply to Jungshik Shin from comment #0)
&gt; EUC-JP in the encoding spec does not support JIS X 212 even though the
&gt; formal definition of EUC-JP does include it. 

Actually the EUC-JP decoder in the encoding spec DOES support JIS X 212.
https://encoding.spec.whatwg.org/#euc-jp-decoder
&gt; If lead and byte are both in the range 0xA1 to 0xFE, set code point to the index code point for (lead − 0xA1) × 94 + byte − 0xA1 in index jis0208 if the euc-jp jis0212 flag is unset and in index jis0212 otherwise.

Did Chrome drop support for decoding JIS X 212 in the EUC-JP decoder?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112064</commentid>
    <comment_count>3</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2014-09-24 05:58:27 +0000</bug_when>
    <thetext>oops. Recently making Blink&apos;s Shift-JIS aligned with the encoding spec, I forgot that EUC-JP does support JIS X 212 when converting to Unicode (decoding). Blink&apos;s EUC-JP was aligned with the encoding spec and does support JIS X 212 when decoding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112071</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-09-24 09:26:16 +0000</bug_when>
    <thetext>It sounds like this is INVALID.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112087</commentid>
    <comment_count>5</comment_count>
    <who name="Jungshik Shin">jshin</who>
    <bug_when>2014-09-24 17:24:15 +0000</bug_when>
    <thetext>Well, the way ICU&apos;s ISO-2022-JP-2 implementation is written, the JIS X 212 table is not shared with EUC-JP converter. Unless I change the ICU to share JIS X 212 table, Blink has to live with the build size increase of tens of kBs. 

In addition, I have to change it unidirectional (decoding only). 

These are doable, but it&apos;s not clear if there&apos;s any user-benefits other than being compliant to the current spec. 

With &quot;ISO-2022-JP&quot; label, Blink (Chrome, Opera) and Safari do not support JIS X 212. They never did (except that I don&apos;t know whether the old Opera ever did). 

With &quot;ISO-2022-JP-1&quot; (or ISO-2022-JP-2) label, Blink and Safari do support JIS X 212 in both directions. Needless to say, virtually nobody uses &apos;ISO-2022-JP-[12]&apos; in charset declaration. So, it does not count. 

MSIE does not support JIS X 212 either in ISO-2022-JP. 

That leaves only Firefox supporting JIS X 212 in ISO-2022-JP at the moment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112163</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-09-25 07:55:06 +0000</bug_when>
    <thetext>Jungshik, thanks for explaining further. I take it Blink will stop supporting &quot;ISO-2022-JP-1&quot; and &quot;ISO-2022-JP-2&quot;?

Masatoshi, Henri, Simon, would we be okay with dropping 212 support from ISO-2022-JP in Gecko?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112173</commentid>
    <comment_count>7</comment_count>
    <who name="Masatoshi Kimura">VYV03354</who>
    <bug_when>2014-09-25 14:23:48 +0000</bug_when>
    <thetext>Gecko&apos;s ISO-2022-JP decoder has JIS X 0212 support mainly because of Thunderbird.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112176</commentid>
    <comment_count>8</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2014-09-25 16:19:45 +0000</bug_when>
    <thetext>(In reply to Jungshik Shin from comment #5)
&gt; MSIE does not support JIS X 212 either in ISO-2022-JP. 
&gt; 
&gt; That leaves only Firefox supporting JIS X 212 in ISO-2022-JP at the moment.

In that case, I think we should remove the ISO-2022-JP-2 aspects of the ISO-2022-JP implementation in Firefox (mozilla-central) and leave it to Thunderbird to support ISO-2022-JP-2 if deemed necessary (should be discoverable via telemetry). (The ISO-2022-JP-2 aspecs involve other weird stuff like a nested GB18030 decoder and a nested EUC-KR decoder.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112342</commentid>
    <comment_count>9</comment_count>
    <who name="Simon Montagu">smontagu</who>
    <bug_when>2014-09-28 09:10:40 +0000</bug_when>
    <thetext>The nested decoders in Gecko&apos;s ISO-2022-JP-2 implementation, weird as they may be, are there to avoid the same duplication of mapping tables that Jungshik wants to avoid in Blink.

Ideally I agree that we want to remove ISO-2022-JP-2 support (not just JIS X 212) from Firefox and from Encoding, though retaining support in Thunderbird, if desired, will be more complicated than other encodings that we&apos;ve removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112344</commentid>
    <comment_count>10</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-09-28 10:48:16 +0000</bug_when>
    <thetext>As far as I know removing iso-2022-jp entirely is a nonstarter. It does seem however that Firefox&apos; implementation is sufficiently special it will not be copied by others and that therefore the specification should not follow it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114485</commentid>
    <comment_count>11</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-11-04 14:22:33 +0000</bug_when>
    <thetext>https://github.com/whatwg/encoding/commit/5a2029026a013a1b9fd871f261dfa4059c96d746</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>