phpQuery make  of   and other



当我有一个文件,我通过phpQuery运行的东西,如 ©在其中以某种方式添加了Â。

所以当我有这个文件(hello。html):
hello, this is a test ©

,然后运行下面的代码:

$f = phpQuery::newDocumentFile( 'hello.html' );
echo $f->html();

得到以下输出:

hello, this is a test ©

有什么我可以做的吗?

Â显示由于编码问题,我会尝试使用utf8_encode将其从ISO-8859-1转换为UTF-8

$markup = file_get_contents('hello.html');
$utf8_markup = utf8_encode($markup);
$doc = phpQuery::newDocumentHTML($utf8_markup);

这是一个相关的post HTML编码问题- " Â "字符出现而不是"   "

相关内容