I use the md5(string) function that returns a md5 hash of the string. I need to get the md5 hash of the CEGUI editbox. When there is english text in the txtPass edit window, everything is OK and my md5 function returns the same hash as the PHP md5() does. But when it comes to cyrillic characters, md5(str) returns incorrect hash (md5(cyrillicstring) == PHP md5(cyrillicstring) -- not my fault).
Here is the code:
Code: Select all
std::string str(txtPass->getText().c_str());
std::string str2="тест";
std::cout << str << " = " << md5(str) << std::endl;
std::cout << str2 << " = " << md5(str2) << std::endl;
The result:
It seems that strings are same except the last symbol in str is <br> (str2 is correct hash).
Also I have no problem displaying cyrillic characters.
Thank you for your attention!