-
Notifications
You must be signed in to change notification settings - Fork 413
Open
Description
CAAlertView *alertView = CAAlertView::createWithText(UTF8("提示"), UTF8("登陆成功"), UTF8("确定"), NULL);
这句在ios下是正常显示的。
如果改成char*
char* sTemp = "登陆成功";
std::wstring ws = utf8_to_unicode(sTemp);
CAAlertView *alertView = CAAlertView::createWithText(UTF8("提示"), unicode_to_utf8(ws.c_str()).c_str(), UTF8("确定"), NULL);
在ios下也是成功的。
但是在win32下却是乱码,原因是 _utf8_to_unicode 把四个汉字处理成了8个字节,在ios下是4个字节。建议在win32下,改用mbstowcs_s
Metadata
Metadata
Assignees
Labels
No labels