static char* MBSCToCEF(const char* mbcsStr) { wchar_t* wideStr; char* utf8Str; int charLen; charLen = MultiByteToWideChar(CP_UTF8, 0, mbcsStr, -1, NULL, 0); charLen=strlen(mbcsStr)+1; wideStr = (wchar_t*) malloc(sizeof(wchar_t)*charLen); MultiByteToWideChar(CP_ACP, 0, mbcsStr, -1, wideStr, charLen); charLen = WideCharToMultiByte(CP_UTF8, 0, wideStr, -1, NULL, 0, NULL, NULL); utf8Str = (char*) malloc(charLen); WideCharToMultiByte(CP_UTF8, 0, wideStr, -1, utf8Str, charLen, NULL, NULL); free(wideStr); return utf8Str; }
使用frame加载网页(含中文字符)时LoadURL,要进行转换,才能加载成功
转自:https://blog.csdn.net/cyloser/article/details/49786401