cstring to utf8
- 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;
- }