3 ms·
A code point is just a number. (Well, a number below 1.1 million.) The simplest way to turn two bytes into a code point is to output the same number. But som
by Dylan16807 6y ago
A code point is just a number. (Well, a number below 1.1 million.)
The simplest way to turn two bytes into a code point is to output the same number.
But some code points are invalid, so you have to skip them. The simplest way is to split your 64k into two ranges. For example numbers 0-50k can get code points 1k-51k, and numbers 50k-64k can get code points 70k-84k.
Base65536 wants to avoid code points that are likely to misbehave, so it uses about ten different ranges of code points, carefully selected to avoid problems (and to look visually cohesive).