News for hackers. Stuff that matters.
Re:UTF-8 is a brilliant design by rockwotj on Friday September 12, 2025 @07:20PM (#45227847)
> outputs 3 chars

You mean codepoints or maybe grapheme clusters?

Anyways yeah it’s a little more complicated but the principle of being able to truncate a string without splitting a codepoint in O(1) is still useful

Re:UTF-8 is a brilliant design by jridgewell on Friday September 12, 2025 @07:28PM (#45227889)
Yah, I was using char interchangeably with code point. I also used byte instead of code unit.

> truncate a string without splitting a codepoint in O(1) is still useful

Agreed!