[whatwg/encoding] Avoid teaching bad UTF-8 math. (#38)

1. Instead of subtracting a magic number, do a bitwise AND to pick a number of least-significant bits that makes sense if you consider the UTF-8 bytes bitwise.
2. Instead of shifting by variable amounts in order to put all bits into their final destination directly, always shift by a constant six and let the higher bits be shifted a number of times.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/encoding/pull/38

-- Commit Summary --

  * Avoid teaching bad UTF-8 math.

-- File Changes --

    M Overview.src.html (30)

-- Patch Links --

https://github.com/whatwg/encoding/pull/38.patch
https://github.com/whatwg/encoding/pull/38.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/pull/38

Received on Thursday, 31 March 2016 12:11:00 UTC