Below is how i write data with unicode character in root folder
<?php
mysql_connect('localhost','root','');
mysql_query ("set character_set_client='utf8'");
mysql_query ("set character_set_results='utf8'");
mysql_query ("set collation_connection='utf8_general_ci'");
mysql_select_db('test') or die('3');
$q = mysql_query("SELECT * FROM `t1`");
$d = '';
while ($r = mysql_fetch_array($q)) {
$d .= $r['col1'];
}
function writeUTF8File($filename,$content) {
$f=fopen($filename,"w");
# Now UTF-8 - Add byte order mark
fwrite($f, pack("CCC",0xef,0xbb,0xbf));
fwrite($f,$content);
fclose($f);
}
writeUTF8File('utf.csv', $d);
?>
but when open this document with Microsoft Office Excel 2007 , the data become
after do quick research i need to import using "From Other Sources"
then i can see correct data
So the question is how to open this document without import("From Other Sources"), because later this document i need pass to my customer(not sure they know about import and do some setting before can see all data).