@nikitonsky I'd note that the advice to use grapheme clusters as the atomic unit of strings is dangerous. First because the clusters are ill-defined (as you note), but second because using them to e.g. parse a message can cause security issues!
For example, imagine a JSON string:
"string"
and use a combining char at the start:
"ˇstring"
(typing on mobile, the hacek is not actually combining)
Now it's not a string anymore. This is an error, but it's possible to imagine an injection attack.
@vjon how is this an injection attack? It’s just an invalid string