16,472
社区成员
发帖
与我相关
我的任务
分享
VOID BIG52GBK(CHAR *pStr, _bstr_t * pbStrText)
{
if(pStr == NULL || pStr[0] == 0)
return;
int nNeedLen = strlen(pStr)+1;
WCHAR * pText = new WCHAR[nNeedLen];
int nReturn = MultiByteToWideChar(950, 0, pStr, nNeedLen, pText, nNeedLen);
*pbStrText = pText;
delete[] pText;
}
#include <windows.h>
#include <iostream>
using namespace std;
int main()
{
char p[] = { 0xc3,0xf6,0xb3,0xac,0}; //"关闭"的big-5码
wchar_t m[20];
memset(m,0,sizeof(wchar_t)*20);
MultiByteToWideChar(10002,0,p,strlen(p),m,20);
wcout.imbue(locale("chs"));
wcout <<m <<endl;
return 0;
}