3 ms·
So, a dumb question, If a code unit is the minimal bit length for encoding a character: why would you need more than one to encode a character? Is this just a
by DigitalJack 13y ago
So, a dumb question, If a code unit is the minimal bit length for encoding a character: why would you need more than one to encode a character?
Is this just a way of saying "variable bit length character encoding?"
- lmm 13y agoIf your character encoding is fixed-bit-length then a code point and a code unit are the same thing yes. If your character encoding is variable-bit-length then a code point is a "character" and a code unit is the thing that a character may be 1 or more of (i.e. a byte in utf8, or a 2-byte thingummy in utf16). The point is that it's better to treat strings as sequences of unicode codepoints ("characters") than treat them as sequences of 16-bit utf16 units like Java does.