4 ms·
Surrogate escaping / UTF-8b is kinda genius. Unicode has two reserved ranges of 256 values each ("surrogates") reserved for the UTF-16 encoding, which are used
by formerly_proven 6y ago
Surrogate escaping / UTF-8b is kinda genius. Unicode has two reserved ranges of 256 values each ("surrogates") reserved for the UTF-16 encoding, which are used there for encoding stuff outside the BMP. Surrogate escaping realizes that 1) These never appear in valid UTF-8, because UTF-8 is a variable-length integer, and doesn't need surrogates 2) So you can use them to pass-through binary data in UTF-8.
- CUViper 6y agoOn the range, the surrogates are actually 10 bits, 1024 possible values. The high surrogate is encoded in 0xD800-0xDBFF, and low in 0xDC00-0xDFFF.