Re:TIL the assumption that string length does not change whe...
by oefrha on Monday November 22, 2021 @01:13AM
(#29303374)
No. In fixed width settings, it’s usually very important to distinguish 0-width characters (I’ll use “characters” for grapheme clusters), 1-width characters, and 2-width characters (e.g. CJK characters and emojis). See wcwidth(3).
[ Parent
| on HN ]
Re:TIL the assumption that string length does not change whe...
by DemocracyFTW on Monday November 22, 2021 @05:18AM
(#29304842)
Very much so. And one may add that the implementation of UAX#11 "East Asian Width"[1] was done in a myopic, backwards-oriented way in that it only distinguishes between multiples 0, 1 and 2 of a 'character cell' (conceptually equivalent to the width one needs in monospace typesetting to fit in a Latin letter). There are many Unicode glyphs that would need 3 or more units to fit into a given text.