如果你是非unicode编译,那么汉字字符直接类型转换为双字节数字  就是其GB2312/GBK编码char szHello[] = "你好";
CString strCP936;
strCP936.Format("%x",*(WORD*)szHello);
strCP936 = strCP936.Mid(2) + strCP936.Left(2); //高字节在前
MessageBox(strCP936);

解决方案 »

  1.   

    CString str1="汉字11223ass";
    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);
      

  2.   

    不一样,有汉字的时候,显示内码为:ffffba,ffffba,而不是我想要的ba,ba
      

  3.   

    那你的汉字是什么编码的?unicode还是ansi还是utf8?