使用函数WideCharToMultiByte()
函数原型
int WideCharToMultiByte( UINT CodePage, DWORD dwFlags, _In_NLS_string_(cchWideChar)LPCWCH lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCCH lpDefaultChar, LPBOOL lpUsedDefaultChar );
int lenth = WideCharToMultiByte(CP_ACP, 0, strUip, -1, NULL, 0, NULL, NULL);
char *ct = new char(lenth);
WideCharToMultiByte(CP_ACP, 0, strUip, -1, ct, lenth, NULL, NULL);