0

Good day everyone.

As the title above, I can print out everything perfectly but the Chinese Characters alien-ed me :(

I tested a few solution which is below:

<?php

//Some Database code
//header("Content-Type: text/csv; charset=UTF-8"); *TESTED*

header("Content-Type: text/csv");
header("Content-Disposition: attachment; filename=pru90th_shoutout_messages.csv");

while($row = mysqli_fetch_assoc($result))
{
    outputCSV(array($row));
}

function outputCSV($data) {


$output = fopen("php://output", "w");

    foreach ($data as $rows) {
    //fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF)); *TESTED*
    fputcsv($output,$rows);
}
fclose($output);
}
?>

but miracle doesn't work on my side.

Again, I'm using MAC Excel 2011.

Please do let me know if there is other solution, I would willing to explore anything. Thanks in advance.

TooJuniorToCode
  • 566
  • 1
  • 5
  • 15
  • @Dagon That's not my solution. Tried mysqli_set_charset($link, 'utf8mb4'); – TooJuniorToCode May 27 '14 at 03:17
  • Thank you for duplicated this question... You're giving me an advice to read all the answer and test all the solution on myself. But all those solution is not working ! Well, guess I will ask another question. – TooJuniorToCode May 27 '14 at 04:02

0 Answers0