title: Excel-generated CSV, special characters disappear (ÆØÅ) - PHP
body: <p>I've got some csv-files that I need to import to our system using php. I live in Norway and we got 3 special characters (æøå and uppercase ÆØÅ). The problem is that the uppercase-versions just disappear from my strings. The lowercase ones are displayed with ?, but when using utf8_encode, I get the correct letters.</p>
  
  <p>I am using the following function to import and read the csv-file. The ÆØÅ-letters are already gone when dumping <code>$arr</code></p>
  
  <pre><code>$row = 1;
  $arr = array();
  if (($handle = fopen($imp['importBreddegave'], "r")) !== FALSE) {
      while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
          $num = count($data);
          $row++;
  
          for ($c=0; $c &lt; $num; $c++) {
              $arr[$row][$c] = $data[$c];
          }
      }
  
      fclose($handle);
  }
  </code></pre>
  
  <p>I guess I need to specify the character-encoding in some way, but I don't manage to figure out how. By standard, cvs-files are encoded by <code>WINDOWS-1257</code> as far as I found out. The rest of my page is encoded with <code>UTF-8</code></p>
  
  <p>Anyone got any neat tricks?</p>