Search code examples
phpphpquerynon-ascii-characters

phpQuery and accented chars


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.


Solution

  • 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 ...