C++宽字符与普通字符的转换实例详解
把字符串转换成宽字符串,
实例代码:
wstring string2Wstring(string sToMatch)
{
#ifdef _A_WIN
int iWLen = MultiByteToWideChar( CP_ACP, 0, sToMatch.c_str(), sToMatch.size(), 0, 0 ); // 计算转换后宽字符串的长度。(不包含字符串结束符)
wchar_t *lpwsz = new wchar_t [iWLen + 1];
MultiByteToWideChar( CP_ACP, 0, sToMatch.c