18,356
社区成员
发帖
与我相关
我的任务
分享
char* strpostdata = "u=JNKD就看见&t=jinyanhui大幅度";
int wcsLen = ::MultiByteToWideChar(CP_ACP, NULL, strpostdata, strlen(strpostdata), NULL, 0);
wchar_t* wszString = new wchar_t[wcsLen + 1];
::MultiByteToWideChar(CP_ACP, NULL, strpostdata, strlen(strpostdata), wszString, wcsLen);
wszString[wcsLen] = '\0';
UNICODE-->utf-8;
int u8Len = ::WideCharToMultiByte(CP_UTF8, NULL, wszString, wcslen(wszString), NULL, 0, NULL, NULL);
char* szU8 = new char[u8Len + 1];
::WideCharToMultiByte(CP_UTF8, NULL, wszString, wcslen(wszString), szU8, u8Len, NULL, NULL);
szU8[u8Len] = '\0';