修正评论乱码

This commit is contained in:
joyqi 2013-11-27 12:01:34 +08:00
parent ee9958def5
commit ed4ca7fd0b

View File

@ -578,9 +578,12 @@ EOF;
if (empty($dom)) {
$dom = new DOMDocument('1.0', self::$charset);
$dom->encoding = self::$charset;
$dom->xmlStandalone = false;
}
@$dom->loadHTML('<?xml encoding="UTF-8">' . $html);
@$dom->loadHTML('<?xml encoding="' . self::$charset . '">'
. '<head><meta http-equiv="Content-Type" content="text/html; charset=' . self::$charset . '"/></head><body>'
. $html . '</body>');
foreach($dom->getElementsByTagName('*') as $node){
$tagName = strtolower($node->tagName);