标签:unicode art echart turn ring out nic get cst
char *UniCodeToUTF8(CString strUniCode)
{
LPWSTR pWstr = new wchar_t[strUniCode.GetLength() + 1];
wcscpy(pWstr, T2W((LPTSTR)strUniCode.GetString()));
//获取转完后的长度
int nLen = WideCharToMultiByte(CP_UTF8, 0, pWstr, -1, NULL, NULL, NULL, NULL);
char *szUtf8 = new char[nLen + 1];
memset(szUtf8, 0, nLen + 1);
//转换
WideCharToMultiByte(CP_UTF8, 0, pWstr, -1, szUtf8, nLen, NULL, NULL);
delete[] pWstr;
return szUtf8;
}
标签:unicode art echart turn ring out nic get cst
原文地址:https://www.cnblogs.com/coolcpp/p/unicode2utf-8.html