title: PHP: Converting UTF-8 string to Ansi?
body: <p>I build a csv string from values I have in my DB. The final string is stored in my $csv variable.</p>
  
  <p>Now I offer this string for download, like this:</p>
  
  <pre><code>header("Content-type: text/csv");
  header("Content-Disposition: attachment; filename=whatever.csv");
  header("Pragma: no-cache");
  header("Expires: 0");
  
  echo $csv;
  </code></pre>
  
  <p>When I open this in Notepad++ for example, it says <em>Ansi as UTF-8</em>. How can I chnage that to Ansi only?</p>
  
  <p>I tried:</p>
  
  <pre><code>$csv = iconv("ISO-8859-1", "WINDOWS-1252", $csv);
  </code></pre>
  
  <p>That did not change anything.</p>
  
  <p>Thanks!</p>
  
  <p><strong>Solution:</strong> 
      $csv = iconv("UTF-8", "WINDOWS-1252", $csv);</p>