I have a plugin that replaces portions of text using text runs and ranges. I'm running into problems with strings with characters like a curled apostrophe because it's stored as "\xe2\x80\x99" so I can't get an accurate string length. I understand special characters like en dashes and thin spaces pose a similar problem.
The plugin is given a vector of UTF-8 std::strings to replace chunks of text in existing text objects. If a string is "Joe’s" then std::string::length returns 7, not 5, and I allocate two characters too many for that block of text.
Does the SDK provide a means of obtaining the correct character count or string length?