https://issues.dlang.org/show_bug.cgi?id=7054

--- Comment #5 from hst...@quickfur.ath.cx ---
Because grapheme clustering is the only sane way to handle output to a field of
fixed length. For example, writeln("%5s", "a\u0301") should treat "a\u0301" as
occupying only a single position in the 5-position wide output field.

Any other solution would introduce further problems, e.g. if we count code
points instead, then the width field in the format string would be basically
useless (the caller will have to manually count output positions -- with
byGrapheme -- and adjust the width accordingly). Furthermore, it would
introduce more special cases (precomposed characters will format differently
from base char + combining diacritic; non-spacing characters will consume field
width but occupy no space in the actual output, etc.).

--

Reply via email to