title: PHP import CSV with umlauts
body: <p>I have a website where my user can upload a file. This file contains some German umlauts (as ö and ä) and is latin_1 encoded. Now I need to convert this file to UTF-8 because this charset is used by my database.</p>
  
  <p>I use the following code:</p>
  
  <pre><code>        $csvFile = fopen($_FILES['file']['tmp_name'], 'r');
          //parse data from csv file line by line
          while(($line = fgetcsv($csvFile, 0, "\t")) !== FALSE){
                  $dbupload-&gt;query("INSERT INTO db (a, b, c) 
                               VALUES ('".$line[0]."', '".$line[3]."', '".$line[1]."')");
              }
          }
  
          //close opened csv file
          fclose($csvFile);
  </code></pre>
  
  <p>If I use this code and import a latin_1 file, PHP skips every line containing an umlaut.</p>
  
  <p>What can I do?</p>
  
  <p>PS: The file is directly passed from the frontend (the page the user uses) to this file which processes it.</p>