News for hackers. Stuff that matters.
Re:TIL the assumption that string length does not change whe... by arcticbull on Monday November 22, 2021 @01:16PM (#29309733)
You just said there was one canonical length for strings then gave me 4: bytes, code points, grapheme clusters and characters, each of which applies in a different context.

I’m not 100% sure what context characters even apply in on a computer other than interest sake.

Invisible/zero-width characters are not interesting when editing text, and character count doesn’t correlate with size, therefore there’s no canonical length.

Re:TIL the assumption that string length does not change whe... by JohnHaugeland on Monday November 22, 2021 @03:09PM (#29311037)
> You just said there was one canonical length for strings then gave me 4: bytes, code points, grapheme clusters and characters, each of which applies in a different context.

The other things have different labels than "length," which you've already been told.

.

> Invisible/zero-width characters are not interesting when editing text

Well, tell Unicode they're wrong, then, I guess.

Have a good day.

Re:TIL the assumption that string length does not change whe... by arcticbull on Monday November 22, 2021 @03:45PM (#29311393)
To be clear I appreciate you sharing the official characters concept definition, and I do think it’s valuable.