News for hackers. Stuff that matters.
Re:It’s Not Wrong that “ ”.length == 7 by cameldrv on Thursday June 01, 2023 @11:58PM (#36160849)
They do very in width, but with a proportional font that’s true even with ASCII text. What grapheme clusters tells you is how many times you have to press the arrow key/backspace to get to the beginning of the string.
Re:It’s Not Wrong that “ ”.length == 7 by tsimionescu on Friday June 02, 2023 @04:19AM (#36162570)
Only if the text editor made some bad assumptions. You're forgetting about non-printable characters, such as the LTR mark. These are not part of grapheme clusters (or are their own grapheme cluster), but the cursor shouldn't probably stop at them.
Re:It’s Not Wrong that “ ”.length == 7 by arcticbull on Friday June 02, 2023 @01:40PM (#36168306)
You know it's been a long time since this conversation but I think, reflecting, it has to do with grapheme clusters not being particularly consistent across operating systems and over time. The article even has an example where one Unicode spec encodes the same 5 USVs and either 1 or 2 graphemes.