具体代码如下:
          CMarkup xmlPsiSiQueryRtn;
xmlPsiSiQueryRtn.SetDoc(_T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"));//支持中文字符
xmlPsiSiQueryRtn.AddElem("Msg");
xmlPsiSiQueryRtn.AddAttrib("Version", 4); xmlPsiSiQueryRtn.IntoElem();//进入节点Msg
xmlPsiSiQueryRtn.AddElem("Return");
xmlPsiSiQueryRtn.AddAttrib("Desc", "成功"); xmlPsiSiQueryRtn.AddElem("ReturnInfo");
…………………………
用UltraEdit看生成的中文都是乱码,请高手指点。

解决方案 »

  1.   

    encoding="GB2312" 不是满好的
      

  2.   

    用GB2312我们读这个xml的接口使用XmlDocument不能显示GB2312
      

  3.   

    自己做GB2312->UTF-8的转换吧
    很简单的这样对以后国际支持也容易些
    比如支持BIG5
      

  4.   

    如果是windows平台的话,可以用WideCharToMultiByte(L"成功"...., CP_UTF8)将成功转换为UTF-8的,然后再存入xml。函数具体参数参考MSDN
      

  5.   

    CMarkupsave以后就是utf-8格式的,UltraEdit看到乱码是
    UE设置的错误
      

  6.   

    FileOutputStream fos = new FileOutputStream(path);
    Writer out = new OutputStreamWriter(fos, "UTF-8");