唉..又是那该死的乱码.NND

下面生成无乱码
 

<?php
$filename=date('Y-m-d').配送表清单.".xls";//建立一个excel文件
header("Content-Type: application/vnd.ms-excel; charset=utf-8");
header("Content-Disposition: p_w_upload; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");
$str.="订单号"."\t";
$str.="姓名"."\t";
$str.="电话"."\t";
$str.="联系电话"."\t";
$str.="预选号码"."\t";
$str.="区域"."\t";
$str.="送机地址"."\t";
$str.="联系人"."\t";
$str.="应收金额"."\t";
$str.="运单号"."\t";
$str.="发货时间"."\n";
echo iconv("UTF-8","GBK",$str);
$conn=mysql_connect("localhost","root","123456");
[color=#FF0000]mysql_query("set character set 'utf8'");//读库
mysql_query("set names 'utf8'");//写库[/color]
mysql_select_db("order");
$sql="SELECT * FROM orders WHERE order_status = 2";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
echoiconv("UTF-8","GB2312",$row['order_num'])."\t";
echoiconv("UTF-8","GB2312",$row['order_name'])."\t";
echoiconv("UTF-8","GB2312",$row['order_phone1'])."\t";
echoiconv("UTF-8","GB2312",$row['order_phone2'])."\t";
echoiconv("UTF-8","GB2312",$row['order_pre_num'])."\t";
echoiconv("UTF-8","GB2312",$row['order_area'])."\t";
echoiconv("UTF-8","GB2312",$row['order_address'])."\t";
echoiconv("UTF-8","GB2312",$row['order_remark3'])."\t";
echoiconv("UTF-8","GB2312",$row['order_pre_money'])."\t";
echoiconv("UTF-8","GB2312",$row['order_express_num'])."\t";
echoiconv("UTF-8","GB2312",date('Y-m-d'))."\n";
}
?>