有2种可能
1、doc = new DOMDocument();
$doc->loadXML($HTTP_RAW_POST_DATA);处理的时候已经帮你自动转换成UTF-8了
2、你服务器的apache或php的默认字符集定义成UTF-8了

解决方案 »

  1.   

    1。你的程序是gbk的编码
    2。php的dom只支持utf8编码
      

  2.   

    你的汉字是什么编码的,你要用iconv等函数把你的汉字的编码转换成utf-8的
    Note that these DOM functions expect (and presumably return) all their data in UTF-8 character encoding, regardless of what PHP's current encoding is. This means that text nodes, attribute values etc, should be in utf8.This applies even if you're generating an XML document which is not ultimately in utf8.
      

  3.   

    回iasky(iasky)
    把汉字编码转成utf-8.
    那为什么CSDN上的没有转换。
    你随便在CSDN上打开一个帖子。另存一下看看?
    这难道和用的语言不同有关系?
      

  4.   

    还有。。如何用php:/input来获取呢?
      

  5.   

    搞明白了。。
    Note that these DOM functions expect (and presumably return) all their data in UTF-8 character encoding, regardless of what PHP's current encoding is. This means that text nodes, attribute values etc, should be in utf8.This applies even if you're generating an XML document which is not ultimately in utf8.
    这段话哪有?
    我在手册上怎么没看到?