Reputation: 5532
This function calculates the number of bytes of the string "str" when encoded in UTF-16.
My question is, what would be a C++ equivalent to implement this?
Upvotes: 2
Views: 247
Reputation: 473302
Just standard C++
Standard C++, including C++11, is not Unicode aware. To get the kind of measuring function you're talking about, you'll have to use another support library like ICU or Windows API functions or iconv or somesuch.
Upvotes: 2