I am trying to generate a CSV file, which gets created perfectly except for the german characters ä,ë,ï,etc I just get the information to a $data variable and tried to use:
utf8_encode($data);
but I get weird text, here are my headers for the file:
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"file1.csv\"");
I have tried using also iconv(); but no luck thus far.
EDIT
just noticed that my $data is already utf-8 so I removed the utf8_encode(); still, when I try to print it I get ?
and changed the header to:
header("Content-Type: text/plain; charset=utf-8");
Use:
And make sure your
$dataisn’t already utf-8!