1 string U2A(const wstring& str)//Unicode字符转Ascii字符 2 { 3 string strDes; 4 if ( str.empty() ) 5 goto __end; 6 int nLen=::WideCharToMultiByte(CP_ACP, 0, str.c_str(), str.size(), NULL, 0, NULL, NULL); 7 if ( 0==nLen ) 8 goto __end; 9 char* pBuffer=new char[nLen+1]; 10 memset(pBuffer, 0, nLen+1); 11 ::WideCharToMultiByte(CP_ACP, 0, str.c_str(), str.size(), pBuffer, nLen, NULL, NULL); 12 pBuffer[nLen]='