title: PHP, UTF-8, IIS and a Fileupload
body: <p>I'm using PHP 5.3 with MSSQL-Server 2005 and MSSQL-Server (PDO) driver from MS.</p>
  
  <p>I recently struggled a litte bit with the new version of the driver and the charset it uses to pass data from the DB. So I decided to configure my whole application to UTF-8 to avaoid these kind of issues in the future.</p>
  
  <p>So I changed the database to use unicode-datatypes, configured the HTML header and set up Eclipse to save the codefiles in UTF-8 format. Also I added the correspondig accept-charset tag to all my HTML forms. So far so good. Everything worked as expected but now I'm stuck with a new issue.</p>
  
  <p>I wrote a simple script that can upload files using a HTML form and save them on my webserver (Windows Server 2003 with IIS6). This worked perfectly until I switched to UTF. When I upload a file with special chars in the filename, these are not saved correctly. Uplading a File named "ÄÖÜ.txt" ends up with a file named "Ã„Ã–Ãœ.txt" on my webserver. This can be a pain because all further processing of these files depends on hyperlinks which are not correct any more.</p>
  
  <p>I tried to several possible solutions like this:</p>
  
  <pre><code>$isMoved = move_uploaded_file($_FILES['uploadedFile']['tmp_name'],"myFolder". utf8_encode($_FILES['uploadedFile']['name']));
  </code></pre>
  
  <p>But I'm always ending upth eiher having a correct file name on the server's filesystem or the other was around. </p>
  
  <p>Anyone an idea? :D</p>
  
  <p>Thanks in advance
  Daniel</p>