This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16476 - Encoding: UTF-8 encoding step 8.2 error
Summary: Encoding: UTF-8 encoding step 8.2 error
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: Encoding (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+encodingspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-22 04:20 UTC by Joshua Bell
Modified: 2012-10-30 17:13 UTC (History)
1 user (show)

See Also:


Attachments

Description Joshua Bell 2012-03-22 04:20:24 UTC
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 >> ((count - 1) * 6)
8.2 just needs to mask off the bits 0x80 | (temp & 0x3f) a.k.a. 0x80 + (temp % 64)
Comment 1 Anne 2012-03-22 10:02:00 UTC
Thanks! http://dvcs.w3.org/hg/encoding/rev/f282674bbe52