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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.