開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC++
問題(Question):
如何用輸入的鍵入中文後轉成Unicode
餵入的資料(Input):
例如輸入 批踢踢
預期的正確結果(Expected Output):
回復三個UINT 25209 36386 36386
補充說明(Supplement):
各位板友好,小的在發文前已閱讀過去關於中文字,Unincode相關文章,
還是不得其要領,
是否有板友能提供更精確的方向,在此大大感謝各位
非常感為各位的協助,此問題已解決,在這邊提供我的作法,回饋本版
const char* pStr1 = str.c_str();
int wchar_size = MultiByteToWideChar(CP_ACP, 0, pStr1, -1, NULL, 0); //求size
wchar_size = wchar_size*sizeof(wchar_t);
wchar_t *pWStr = new wchar_t[wchar_size + 1];
//使用剛剛求出的size建立寬字元字串
MultiByteToWideChar(CP_ACP, 0, pStr1, -1, pWStr, wchar_size);
如有想法還不吝嗇回文提供