title: scandir issue with accents in Linux work fine in OSX
body: <p>Hi im using the next function to create a tree directory menu in my website, the directories include a lot of pdf and excel, sometimes the name of this files have accents, spaces and ñ, My application work perfectly in OSX (mac) but a soon I uploaded in my godaddy server (linux), all the characters with accent were replace by the <code>?</code> character breaking all the names and the link. Do you know how to deal with this issue? I been reading about urlencode, urlrawencode, inclusive I read, this comment in the php documentation site as comment:</p>
  
  <blockquote>
    <p>Scandir does not work properly with non-english caracters (like french
    accents for example : éàçè...) in the files name. As PHP does not
    support unicode operations until PHP 6, this is not a bug.</p>
  </blockquote>
  
  <p>I hope somebody can help me in solve this.</p>
  
  <pre><code>function listFolderFiles($dir){
      $ffs = scandir($dir);
      echo '&lt;ul class="transparencia"&gt;';
      foreach($ffs as $ff){
          if($ff != '.' &amp;&amp; $ff != '..' &amp;&amp; $ff != '.DS_Store'){
              $stringFileDir = $dir.'/'.$ff;
              echo '&lt;li&gt;';
              if(is_file($stringFileDir)){
                  echo "&lt;a href='transparencia/".$dir.'/'.$ff."' data-type='".pathinfo($stringFileDir)['extension']."' target='_blank'&gt;".$ff."&lt;/a&gt;";
              }else{
                  echo "&lt;span class='more'&gt;+&lt;/span&gt;".urldecode($ff);
              }
  
  
                  if(is_dir($dir.'/'.$ff)){
                      listFolderFiles($dir.'/'.$ff);
                  }
  
              echo '&lt;/li&gt;';
          }
      }
      echo '&lt;/ul&gt;';
  }
  </code></pre>