string to wstring 以及全角字符转换为半角字符
string to wstring 转换
std::wstring s2ws(const std::string& s)
{
setlocale(LC_ALL, "chs");
const char* _Source = s.c_str();
size_t _Dsize = s.size() + 1;
wchar_t *_Dest = new wchar_t[_Dsize];
wmemset(_Dest, 0, _Dsize);
mbstowcs(_Dest, _Source, _Ds
原创
2020-06-30 10:35:12 ·
310 阅读 ·
0 评论