OpenX统计报表的乱码问题
大恐龙 发表于 2009年9月24日 16:30
我使用的版本是openx-2.8.1。在导出excel表格时遇到乱码,原来其实很简单,就是php字符串编码问题,iconv一下就行:
1、文件名:lib/pear/Spreadsheet/Excel/Writer.php文件的function send($filename)函数,第67行加上$filename = iconv("utf-8", "gb2312", $filename);文件名由xxxxxxxx.变成广告分析报告 xxx From Beginning 到 27-03-2009.xls。
2、excel文件内容:lib/pear/Spreadsheet/Excel/Writer/Worksheet.php文件的Writerfunction write($row, $col, $token, $format = 0)函数,第1166行替换为return $this->writeString($row, $col, iconv("utf-8", "gb2312", $token), $format);
3、工作表名称:lib/pear/Spreadsheet/Excel/Writer/Workbook.php文件的function &addWorksheet($name = '')函数,第318行加上$name = iconv("utf-8", "gb2312", $name);

原创作品,转载请
Tags:













![[Valid RSS]](http://www.w3cool.com//images/valid-rss.png)
![Validate my Atom 1.0 feed [Valid Atom 1.0]](http://www.w3cool.com//images/valid-atom.png)





