So, challenge to the #gnome #gtk #vala wizards out there: is this the best we can do to count Unicode glyphs in a string (equivalent of string.characters.count in Swift) or is there a more performant way I don’t know about?
(It’s fast enough for my needs but not ideal by any means.)
@aral Unicode does not have a concept of glyph, so it's an incorrect question to ask.
In all cases, one has to look at what one actually needs, and decide on the solution based on that. Sometimes it's bytes, sometimes it's unicode codepoints, sometimes it's grapheme clusters, or could could be something entirely different.
This is my personal Mastodon.