4 ms·
It only goes to 31 bits, otherwise you are correct. Although the term "character" is ambiguous so Unicode use more specific terms. An encoded integer represent
by goto11 6y ago
It only goes to 31 bits, otherwise you are correct.
Although the term "character" is ambiguous so Unicode use more specific terms. An encoded integer represent a "code point" which usually corresponds to a character, but in some cases characters are represented by multiple code points. For example "â" might be represented by the code point for "^" following the code point for "a". This in turn opens a whole can of worms since the same character can be represented as code points in multiple ways.
- Someone 6y agoThe encoding scheme goes to 31 bits, but UTF-8 nowadays goes to ≈20 bits. https://en.wikipedia.org/wiki/UTF-8#Invalid_code_points https://en.wikipedia.org/wiki/UTF-8#Invalid_code_points: “Since RFC 3629 (November 2003), the high and low surrogate halves used by UTF-16 (U+D800 through U+DFFF) and code points not encodable by UTF-16 (those after U+10FFFF) are not legal Unicode values, and their UTF-8 encoding must be treated as an invalid byte sequence.”