我有这个代码,我用它来导出一个CSV查询,问题是,如果我用Excel打开这个俄语字符将不会显示,但如果我打开它与数字(Mac)他们显示.
现在,我无法解决这个问题.我添加了一些我在互联网上看到的线条而没有...
<?php
/*
* PHP code to export MySQL data to CSV
* http://salman-w.blogspot.com/2009/07/export-mysql-data-to-csv-using-php.html
*
* Sends the result of a MySQL query as a CSV file for download
*/
/*
* establish database connection
*/
$conn = mysql_connect('', '', '') or die(mysql_error());
mysql_select_db('', $conn) or die(mysql_error($conn));
mysql_query("SET NAMES UTF8");
/*
* execute sql query
*/
$query = sprintf('SELECT fields FROM table');
$result = mysql_query($query, $conn) or die(mysql_error($conn));
/*
* send response headers to the browser
* following headers …Run Code Online (Sandbox Code Playgroud)