News for hackers. Stuff that matters.
Re:C Strings and my slow descent to madness by nordsieck on Thursday April 06, 2023 @11:07AM (#35469344)
> Also it says "strlen("有り難う")); [...] and the output is… The length of the string is 12 characters". But according to "man strlen": "RETURN VALUE: The strlen() function returns the number of bytes in the string pointed to by s.". It says nothing about "number of characters".

Yeah - when dealing with Unicode, you have to be very clear about whether you're dealing with bytes, runes or glyphs.

Re:C Strings and my slow descent to madness by riceart on Thursday April 06, 2023 @03:29PM (#35473229)
Runes are not a Unicode concept - that’s a Golangism. Basically a code point.

Also in terms of Unicode, graphemes are even more relevant to the programming side than glyphs - unless you’re writing a renderer.