• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

getting correct string length when it includes apostrophe character \xe2\x80\x99

Engaged ,
Feb 01, 2021 Feb 01, 2021

Copy link to clipboard

Copied

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?

TOPICS
SDK

Views

120

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Adobe