News for hackers. Stuff that matters.
Re:It’s Not Wrong that “ ”.length == 7 by eviks on Thursday June 01, 2023 @10:46PM (#36160244)
What do you mean there is no such thing as a character when grapheme cluster is exactly that? This is also the out-of-context , and people get confused because instead of this human context attribute they've been forced to use all the other alternatives that require more knowledge
Re:It’s Not Wrong that “ ”.length == 7 by arcticbull on Thursday June 01, 2023 @10:52PM (#36160286)
Characters in context are printable or non-printable/formatting marks right? I agree they probably meant grapheme clusters, but grapheme clusters can vary dramatically in width so the point of the conversation was to explain why a bounding box was a better approximation of their goals.
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.
Re:It’s Not Wrong that “ ”.length == 7 by eviks on Friday June 02, 2023 @01:50AM (#36161522)
> grapheme clusters can vary dramatically

so do 'www' and 'iii' (though less dramatically), that't not a foreign concept to designers, not sure they'd want to bound 'www' to the width of 'iii'