Slide 58
Slide 58 text
Doubler Code Point
// Doubler.js: UTF16 Safe packer
// Mobile Browser unavailable UTF16 words:
// Safari: NULL, BOM
// Chrome: NULL, BOM, SurrogatePairs
// Android: NULL
//
// Desktop Browser unavailable UTF16 words:
// Safari: NULL, BOM
// Chrome: NULL, BOM, SurrogatePairs
//
// +- UINT16 -+- Doubler.pack() -+- unpack -+
// | 0x0000 | 0x0020, 0x8000 | -0x8000 | encode NULL
// +----------+------------------+----------+
// | 0x0020 | 0x0020, 0x8020 | -0x8000 | encode 0x20
// +----------+------------------+----------+
// | 0xd800 | 0x0020, 0x5800 | +0x8000 | encode SurrogatePairs
// | : | : | |
// | 0xdfff | 0x0020, 0x5fff | |
// +----------+------------------+----------+
// | 0xfffe | 0x0020, 0x7ffe | +0x8000 | encode BOM
// | 0xffff | 0x0020, 0x7fff | |
// +-- Tail --+- Doubler.pack() -+----------+
// | 0x00 | 0x0020, 0x9000 | -0x9000 | encode Tail byte
// | : | : | |
// | 0xff | 0x0020, 0x90ff | |
// +----------+------------------+----------+