I tested the Unicode conversion with a UNICODE MFC dialog app, where I can input some Chinese in the edit box. After reading in the characters using
DDX_Text(pDX, IDC_EDIT1, m_strUnicode) UpdateDate(TRUE)
the m_pszdata
of m_strUnicode
shows "e0 65 2d 4e 1f 75 09 67". Then I used the following code to convert it to char*:
char *psText; psText = new char[dwMinSize]; WideCharToMultiByte (CP_OEMCP, NULL, m_strUnicode,-1, psText, dwMinSize, NULL, FALSE);
The psText
contains "ce de d6 d0 c9 fa d3 d0", nothing similar with the m_pszdata
of m_strUnicode. Would anyone please explain why it is like that?