如果你是非unicode编译,那么汉字字符直接类型转换为双字节数字 就是其GB2312/GBK编码char szHello[] = "你好";
CString strCP936;
strCP936.Format("%x",*(WORD*)szHello);
strCP936 = strCP936.Mid(2) + strCP936.Left(2); //高字节在前
MessageBox(strCP936);
CString strCP936;
strCP936.Format("%x",*(WORD*)szHello);
strCP936 = strCP936.Mid(2) + strCP936.Left(2); //高字节在前
MessageBox(strCP936);
CString temp,str2="";for(int i=0;i<str1.GetLength();i++)
{
temp.Format("%02x,",str1[i]);
str2+=temp;
}str2=str2.Left(str2.GetLength()-1); //去掉最后一个逗号
MessageBox(str2);