vc程序中如何把汉字写入xml文件,并且xml文件能打开看到写入的汉字
我的vc项目属性是 Use Multi-Byte Character Set

解决方案 »

  1.   

    xml文件编码为utf-8 即可正常使用汉字。
      

  2.   

    XML一般用UTF8编码格式,这样来写入读取文件就能支持汉字
      

  3.   

    我用xmlNodeSetContent(node,(const xmlChar *)strProp);strProp是"你好"确实写入了xml文件节点,这个节点下是"你好"。但是打开xml文件出现:无法显示 XML 页。 
    使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。 
    --------------------------------------------------------------------------------文本内容中发现无效字符。处理资源 'file:///D://license/debug/licensefiles/ggh.xml' 时出错。第 2 行,位置: 201 <LinkTrust url="http://www.is-one.net/LinkTrust/HAWK"><system><specVersion><major>8.2</major>&...
     为什么?是写入xml之前要执行gb2312转化utf-8吗?
      

  4.   

    xml一般都指定utf8,所以所有文字都是utf8格式的。
      

  5.   


    TiXmlDocument doc;
    TiXmlDeclaration* pDecl;
    pDecl = new TiXmlDeclaration("1.0","GB2312","yes");
    doc.LinkEndChild(pDecl);