There's a bug with the char-handling only if we assume that they had actually wanted to count Unicode codepoints. But would fixing the code to count Unicode codepoints solve the problem that characters don't match users' expectations?
No, because even after fixing codepoints, and assuming that everything is perfect and "bug-free", Unicode considers
q̊q̊q̊ to be 6 codepoints, whereas it is really only 3 user-perceived characters.
So perhaps, the "bug" or problem here is that we are using Unicode. Unicode codepoints do not map directly (one codepoint for each user-perceived character) onto the writing systems taught in schools, because Unicode claims that it's too hard to do so for all languages. As such, a user-perceived character is not the same as Unicode codepoint.
The easiest solution would be to ignore the problem. Users are already used to "weird behavior" for characters outside the so-called "English range". No one's going to be too surprised.
The easier solution is to change the message from "10 characters left" to "10 Unicode codepoints left". (Needless to say, this kind of information is pretty useless to users.) Another easy solution is to convey a vague message, e.g. "about 10 characters left". (Like how Google Search often gives a vague estimate.)
The (extremely) hard but proper solution will be to allow users to enter only user-perceived characters. This is basically white-listing every character that's going to be supported, as opposed to blacklisting anomalies one by one. For example:
If the use case is to accept English written language, the white-list will accept only the characters
Z. Probably adding more if needed (
@, etc) on a case-by-case basis. The white-list will prevent any chances for anomalies to happen.
If the use case is to accept Japanese written language, the white-list will accept only the 1006 + 1130 + ~40 + ~40 characters. Probably adding more if needed (e.g. supporting obsolete hiragana/katakana/kanji, and non-kanas like
ゝ, etc.) on a case-by-case basis.
If the use case is to accept PRC Chinese written language, the white-list will accept only the 8105 characters, probably adding more if needed on a case-by-case basis.
And so on.
With pure white-listing, we can control every single input such that there would be no way for users to enter "weird" stuff like emoji characters and etc.