mastodon.ar.al is one of the many independent Mastodon servers you can use to participate in the fediverse.
This is my personal fediverse server.

Administered by:

Server stats:

1
active users

@aral

never used Vala personally but curious if `char_count()` may do what you are looking for. It appears `length()` returns the number of bytes.

valadoc.org/glib-2.0/string.le

valadoc.orgstring.length – glib-2.0The canonical source for Vala API references.

@bmallred Nope, sadly char_count does not take grapheme clusters into consideration. Did try :)

@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.