I have a mysql table with a character stored as "û" (u with a circumflex). I am exporting this via php to csv. I have tried everyhting but just cant get û in the export file. I do see things like "?" or "È" and "û".
Question: how can I properly export the data from mysql to a CSV file using PHP so I see "û" in the DB as "û" in the exported file?
Our php drill
mb_internal_encoding("UTF-8");
$list = $readConnection->fetchAll($query);
$fp = fopen($file, 'w');
setlocale(LC_MONETARY, 'nl_NL');
# Loop over lines here
$line = utf8_encode($db_row);
fputcsv($fp, $line);
I have also tried adding a BOM fprintf($fp, chr(0xEF).chr(0xBB).chr(0xBF)); // set UTF 8 header, not working