phpQuery and accented chars
-
13-06-2021 - |
質問
When I parse html using phpQuery, I got bad results with accentuated chars. The following code echo craps...
<?php
require_once 'phpQuery.php';
$dom = phpQuery::newDocumentHTML('<p>é</p>');
echo $dom->text(); //bad result
?>
Anybody know about accentuation in phpQuery?
I'm using netbeans on windows 2008 server with firefox.
解決
Try to add on your page :
header("Content-Type:text/html; charset=UTF-8");
You welcome !
And by the way, I believe you use Windows 2008 Server and not Windows 7 Server ...
他のヒント
Try that:
echo htmlspecialchars($dom->text());
Have you tried
string utf8_decode ( string $data )
or
string utf8_encode ( string $data )
I believe as my previous answer that it must be a UTF-8 problem.
所属していません StackOverflow