02-02-2021, 03:26 PM
In the meantime, I have a function that seems to give an accurate character count for strings including extended UTF-8 characters. I'm sure it can be improved, but it's enabled me to define text ranges to better handle text runs, and may be useful for others as well.
Code:
long charCount(std::string s){
long len = s.length();
uint32_t e = hdi::core::strings::substrCount(s, "\xe2\x80");
len -= (e*2);
e = hdi::core::strings::substrCount(s, "\xe2\x81");
len -= (e*2);
return len;
}