当我通过phpQuery运行一个包含 或©之类内容的文件时,会以某种方式添加一个。
因此,当我有这个文件(hello.html)时:
hello, this is a test ©然后我运行这段代码:
$f = phpQuery::newDocumentFile( 'hello.html' );
echo $f->html();我得到以下输出:
hello, this is a test ©有什么我能做的吗?
发布于 2013-01-08 10:57:06
由于编码问题,我会尝试使用utf8_encode将其从ISO-8859-1转换为UTF-8
$markup = file_get_contents('hello.html');
$utf8_markup = utf8_encode($markup);
$doc = phpQuery::newDocumentHTML($utf8_markup);这是一个相关的帖子HTML encoding issues - “” character showing up instead of “ ”
https://stackoverflow.com/questions/7347827
复制相似问题