If my QString only has ascii character, I can convert it to std::string or char* as follow:
std::string str = x.toStdString();
str.c_str();
QString x = "hello";
std::string str = x.toStdString();
str.c_str();
To copy to clipboard, switch view to plain text mode
But if my QString has chinses character, I cannot conver it to std::string or char*.
std::string str = x.toStdString(); //str will become Unrecognizable Code.
str.c_str();
QString x = " 你 好 ";
std::string str = x.toStdString(); //str will become Unrecognizable Code.
str.c_str();
To copy to clipboard, switch view to plain text mode
Bookmarks