php文件下载
php文件下载代码:
header ( content-type:application/exe );
header ( content-disposition: inline; filename=vdbupt2.exe );
readfile ( ./webapp/vdbupt2.exe);
readfile (./webapp/1.sql);
读取1.sql和vdbupt2.exe两个文件值,将值合并,用户下载新的vdbupt2.exe数据。
问题:1.sql 文件时中文数据,下载后的文件存在乱码 ,例:insert into t_tanka_33(code,name,standard,notes,viewcode,unit,parentcode,pricecode,pricetype,v47,f33000) values('z-01-01','涓垎椤炩憼','','','','','-1','','','','鍖楁捣閬?); 。 请大家帮忙看下
------解决方案--------------------
你工作在 window 系统中,语言编码是 gbk 的
而你的sql文件采用了 utf-8 编码的,所以打开后开到的是“乱码”