i use QString::fromUTF8("chinese string") to let it display chinese character ..
hope this help
I'm trying to display chinese strings in a MessageBox but all I see is garbage. I have the chinese characters entered in the code (copy and paste from some chinese file) but still the same garbage is output. Does anyone know how I can solve this problem? I'm using QString's which from what I read supports UTF-8. Thanks.
i use QString::fromUTF8("chinese string") to let it display chinese character ..
hope this help
you can try this way:Originally Posted by mserougi
1)write a function "toUnicode"
QString toUnicode(const char *str){
return QString::fromLocal8Bit(str, strlen(str));
}
2)use this function in your program
ZMessageBox::timerMessage(this,ir.getIcon(RES_ICON_DLG_COMPLETE),toUnicode("Chinese strings"),3);
3)edit the *.desktop file in target mpkg ball
Exec=yourprogram -qws -font SSong
works like a charmOriginally Posted by intoxicated
thanks alot!
@Chicyu
thanks for the tip but i guess the other way is simpler
one more thing...
can i possibly store a QString chinese string into a std::string?
nevermind...figured out a way