typedef unsigned short UTF16;
CString strName;
UTF16 utf16[256+1]; //获得的数据,存放在utf16中。
//需要通过变量strName 来显示utf16 的数据
........
AfxMessageBox(strName);请问应该如何将utf16 转换 为strName 啊?开发环境:VS2010,字符集为多字节字符集UTF16转换asciiCString
CString strName;
UTF16 utf16[256+1]; //获得的数据,存放在utf16中。
//需要通过变量strName 来显示utf16 的数据
........
AfxMessageBox(strName);请问应该如何将utf16 转换 为strName 啊?开发环境:VS2010,字符集为多字节字符集UTF16转换asciiCString
for(int i=0;i < 256; i++)
s.AppendFormat(L"%02X", utf16[i]);
不行么?
memset(buf, 0, sizeof(buf));
WideCharToMultiByte ( CP_ACP, WC_COMPOSITECHECK, (LPCWSTR)utf16, -1, buf, 256, NULL, NULL );
strName.Format(_T("%s"),buf);