I found solutions here but still got problems. I have data table in my website which one uses Georgian Fonts, in my MYSQL database those fonts are displayed normally but when I try to download this table using export.php in my PC with .csv file the fonts are like
გáƒáƒ¡áƒáƒ¡áƒ•áƒšáƒ”ლში
In my export.php the code is below:
if(isset($_POST["export"]))
{
header('Content-Transfer-Encoding: binary');
header('Content-Type: text/csv; charset=UTF-8');
header('Content-Disposition: attachment; filename=data.csv');
$output = fopen("php://output", "w");
fputcsv($output, array('არდუინოს N','ტრანზაქცია', 'User ID', 'Transaction Date', 'Object Name', 'Terminal Name', 'Amount'));
$query = "SELECT * FROM Table WHERE userID='$userID' ORDER BY trID DESC";
$result = mysqli_query($db, $query);
while($row = mysqli_fetch_assoc($result))
{
fputcsv($output, $row);
}
fclose($output);
}
Download works fine I got file data.csv but inside this file characters are unrecognized Link for Image
Any ideas? What is wrong ? If you think that is duplicated Question then I can tell you NO because before posting here I found lots of same solutions but nothing helps In my database connection php file I have added
$db->set_charset("utf8");
and
mysqli_query("SET NAMES 'utf8';");
But nothing changed... Any tips what would cause this problem would be great, Thank you guys in advance...