3 ms·
In terminals there is a distinction between single-width and double-width characters (east-asian characters, in particular). E.g. the three characters A美C
by layer8 3y ago
In terminals there is a distinction between single-width and double-width characters (east-asian characters, in particular). E.g. the three characters
A美C
would take up the width of four ASCII monospace characters, the “美” being double-width.
Similarly, for composed characters like say the ligature “ff”, you may want to backspace as if it was two “f”s (which logically it is, and decomposes to in NFKD normalization).
- jameshart 3y agoUnicode even has distinct full width and half width variants of Japanese katakana - where ‘full width’ is (in theory) as wide as two Latin characters. Latin: Katakana Full width: カタカナ Half width: カタカナ (How that fixed width text looks in a web browser is anyone’s guess though. On iOS none of the Japanese kana stay on the fixed grid.)
- layer8 3y agoThe background here is that both are contained in the Japanese Shift JIS character set, and Unicode provides roundtrip compatibility. And they are in Shift JIS because the half-width katakana were in the 8-bit JIS character set [0] used with text-mode displays where all characters have the same width. To preserve screen layout, these later had to be distinguished from full-width katakana. [0] https://en.wikipedia.org/wiki/JIS_X_0201 https://en.wikipedia.org/wiki/JIS_X_0201
- deleted 3y ago[deleted]