<?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>19979</bug_id>
          
          <creation_ts>2012-11-16 09:28:47 +0000</creation_ts>
          <short_desc>Definition of &apos;encoding&apos; doesn&apos;t work e.g. for iso-2022-jp</short_desc>
          <delta_ts>2012-11-16 12:15:20 +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="Martin Dürst">duerst</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>mike</cc>
          
          <qa_contact>sideshowbarker+encodingspec</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>78381</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2012-11-16 09:28:47 +0000</bug_when>
    <thetext>&apos;encoding&apos; is currently defined as follows:

An encoding defines a mapping from a code point to one or more bytes (and vice versa).

This does not work e.g. for iso-2022-jp, because that can only be explained as a mapping from a sequence (one or more) of code points to a sequence (one or more) of bytes (and vice versa).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78392</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-11-16 11:50:10 +0000</bug_when>
    <thetext>Why is that? I can see how this is the case for big5 though. How about &quot;An encoding defines a mapping from a code point sequence to a byte sequence (and vice versa).&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78395</commentid>
    <comment_count>2</comment_count>
    <who name="Martin Dürst">duerst</who>
    <bug_when>2012-11-16 12:02:25 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Why is that? I can see how this is the case for big5 though. How about &quot;An
&gt; encoding defines a mapping from a code point sequence to a byte sequence
&gt; (and vice versa).&quot;?

The fix looks okay! But I don&apos;t understand why you think this is needed for Big5, but not for iso-2022-jp. If I have the byte sequence 0x24 0x24, is iso-2022-jp, this can either be &quot;$$&quot; or &quot;い&quot; (Hiragana I). So you need context to know which it is, you can&apos;t just convert one code point at a time. For Big5, on the other hand, you can convert one code point at a time assuming you get &quot;packets&quot; of bytes that each represent a code point.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>78398</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-11-16 12:15:20 +0000</bug_when>
    <thetext>https://github.com/whatwg/encoding/commit/088780df57d0b4d567aad175d2be3d46980b7561

Sure, you need multiple bytes for one code point. The definition already covered that... big5 however can emit two code points sometimes.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>