Code:
std::string str =""; std::cout<<str.length()<<std::endl;
this code returns 20, hence each unicode character is considered as 4 bytes, but the same code in java returns 10, where each unicode character is considered as 2 bytes.
My Question why java and c++ treats different size for the same kind of character, also if it is because of their own implementation, then give me a way to convert the c++ unicode strings to java readable unicode strings.
Eg:
Code:
std::string cpluscplustoJava(std::string str)
{
/**
* This function should return the same
* string with length as 10 byes..:P, It is possible??
*/
}
Comment