void CDlgPatientList::ConvertGBKToUtf8(CString& amp, CString str_multi)
{
//CString str_utf8;
int len = MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)str_multi, -1, NULL, 0);
wchar_t * wszUtf8 = new wchar_t[len + 1];
memset(wszUtf8, 0, len * 2 + 2);
MultiByteToWideChar(CP_ACP, 0, (LPCTSTR)str_multi, -1, wszUtf8, len);
len = WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, NULL, 0, NULL, NULL);
char *szUtf8 = new char[len + 1];
memset(szUtf8, 0, len + 1);
WideCharToMultiByte(CP_UTF8, 0, wszUtf8, -1, szUtf8, len, NULL, NULL);
amp = szUtf8;
delete[] szUtf8;
delete[] wszUtf8;
//return str_utf8;
}
void CDlgPatientList::utf8ToMulti(CString& str_GBK,CString strutf)
{
int len = MultiByteToWideChar(CP_UTF8, 0, (LPCTSTR)strutf, -1, NULL, 0);
wchar_t * wszMulti = new wchar_t[len + 1];
memset(wszMulti, 0, len * 2 + 2);
MultiByteToWideChar(CP_UTF8, 0, (LPCTSTR)strutf, -1, wszMulti, len);
len = WideCharToMultiByte(CP_ACP, 0, wszMulti, -1, NULL, 0, NULL, NULL);
char *szMulti = new char[len + 1];
memset(szMulti, 0, len + 1);
WideCharToMultiByte(CP_ACP, 0, wszMulti, -1, szMulti, len, NULL, NULL);
str_GBK = szMulti;
delete[] wszMulti;
delete[] szMulti;
}