C++ knows nothing about encodings, so you can't expect to use astandard function to do this.

This (as well as most of the answers) seemed to be lacking, but unfortunately as a new user I cannot down-vote them. The standard library indeed does acknowledge the existence of character encodings, in the form of locales. If your system supports a locale, it is very easy to use the standard library to compute the length of a string. In the example code below I assume your system supports the locale en_EN.UTF-8. If I compile the code and execute it as "./a.out ソニーSony", the output is that there were 13 char-values and 7 characters. And all without any reference to the internal representation of UTF-8 character codes or having to use 3rd party libraries.