80,351
社区成员
发帖
与我相关
我的任务
分享
int retVal = -1;
size_t nSize = wcslen(unicode);
char*ansi = new char[nSize+1];
memset( ansi, 0x00, (nSize + 1)*sizeof(char) );
std::string str;
// setlocale( LC_ALL, "zh_CN.gbk" );
retVal = wcstombs( ansi, unicode, nSize );
if ( retVal != -1 )
{
str = ansi;
}
delete []ansi;
return str;