Unicode characters can be used in CSV files, just make sure you use the correct HTTP headers. This works fine in OpenOffice, but if I remember that the correct Excel has problems displaying CSV files with Unicode characters.
In addition, you should try to use fputcsv , this will simplify the situation. When you create files on the fly, you can use php output stream .
So something like this:
$handle = fopen("php://output", "w");
header("Content-Type: text/csv; charset=UTF-8");
fputcsv($handle, $fields, ';', '"');
fclose($handle);
, htmlentities, é. , , . html_entity_decode :
$decoded_string = html_entity_decode($string, ENT_QUOTES, 'UTF-8');
Btw, htmlentities , , html ( ), . unicode.