C++ knows nothing about encodings, so you can't expect to use a
standard 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.
using namespace std;
int main(int argc, char *argv)
unsigned int strLen = str.length();
cout << "Length (char-values): " << strLen << '\n';
unsigned int u = 0;
const char *c_str = str.c_str();
unsigned int charCount = 0;
while(u < strLen)
u += mblen(&c_str[u], strLen - u);
charCount += 1;
cout << "Length (characters): " << charCount << endl;