I am building a csv string from the values that I have in my database. The final line is stored in my $ csv variable.
Now I suggest this line for loading, for example:
header("Content-type: text/csv"); header("Content-Disposition: attachment; filename=whatever.csv"); header("Pragma: no-cache"); header("Expires: 0"); echo $csv;
When I open this in Notepad ++, for example, it says Ansi is UTF-8. How can I use this only for Ansi?
I tried:
$csv = iconv("ISO-8859-1", "WINDOWS-1252", $csv);
This has not changed anything.
Thanks!
Solution: $ csv = iconv ("UTF-8", "WINDOWS-1252", $ csv);
source share