title: Why does the PHP function htmlentities(...) returns wrong results?
body: <p>I have the following code : </p>
  
  <pre><code>function testAccents() {
      $str = "àéè";
      $html = htmlentities($str);
      echo $html;
  }
  </code></pre>
  
  <p>When I run it, instead of getting <code>&amp;agrave;&amp;eacute;&amp;egrave;</code> I get <code>&amp;Atilde;&amp;nbsp;&amp;Atilde;&amp;copy;&amp;Atilde;&amp;uml;</code>.</p>
  
  <p>I thought that it could be a problem of encoding but the file is utf-8 : </p>
  
  <pre><code>&gt; file -bi PublicationTest.php 
    text/x-c++; charset=utf-8
  </code></pre>
  
  <p>Why do I get this strange result ? </p>
  
  <p>EDIT: I use PHP 5.3.</p>