I generate csv with PHP ...but some Greek letters appear as "?"

I generate csv with PHP
but some Greek letters appear as “???” HOW APPEAR THEM IN GREEK IN CSV…?

how to fix???
csv go to server and ftp download it… I have Linux live server and local XAMPP …WINDOWS

$fp = fopen('file3000.csv', 'w');
fputcsv($fp, array("carId","make","carYear","carPrice","ac","LOCATION","TEL1","sponsoredCar","img"));

fputcsv($fp, array($carId,$make,$carYear,$carPrice,$ac,$LOCATION,$TEL1,$sponsoredCar,$img));


It is most likely the file encoding. The followign might help:

this do not explain clearly… for greek/english chars what should use?

Have you looked at doing this to write your output out?

after try and read
this worked thks

in db => generate csv

mysql_query("SET NAMES utf8");	// before make / execute query

in differ php file get csv and regenerate it

header("Content-disposition: filename=v1.csv");  // destination
print "\xEF\xBB\xBF"; // UTF-8 BOM
readfile("file3000.csv");  // source

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.