<?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>16476</bug_id>
          
          <creation_ts>2012-03-22 04:20:24 +0000</creation_ts>
          <short_desc>Encoding: UTF-8 encoding step 8.2 error</short_desc>
          <delta_ts>2012-10-30 17:13:03 +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="Joshua Bell">jsbell</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>65942</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-03-22 04:20:24 +0000</bug_when>
    <thetext>Section 6.1 - utf-8 encoding

Step 8.2: Append to bytes 0x80 + the remainder of dividing temp by 64^count (as integers).

I believe this should simply be:

Append to bytes 0x80 + the remainder of dividing temp by 64 (as integers).

8.1 already does the shift: temp = code_point &gt;&gt; ((count - 1) * 6)
8.2 just needs to mask off the bits 0x80 | (temp &amp; 0x3f) a.k.a. 0x80 + (temp % 64)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65943</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-03-22 10:02:00 +0000</bug_when>
    <thetext>Thanks! http://dvcs.w3.org/hg/encoding/rev/f282674bbe52</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>