- char* UnicodeToUtf8(CString unicode)
- {
- int len;
- len = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR)unicode, -1, NULL, 0, NULL, NULL);
- char *szUtf8=new char[len + 1];
- memset(szUtf8, 0, len * 2 + 2);
- WideCharToMultiByte (CP_UTF8, 0, (LPCWSTR)unicode, -1, szUtf8, len, NULL,NULL);
- return szUtf8;
- }
时间: 2024-11-10 07:18:25