找回密碼
 註冊
搜索
查看: 3471|回復: 0

FengOffice 2.0 壓縮及解壓縮檔名亂碼問題 in Windows

[複製鏈接]
發表於 2012-4-9 08:54:43 | 顯示全部樓層 |閱讀模式
壓縮檔內容檔名亂碼問題
修改 fengoffice\application\controllers\FileController.class.php 2112行

  1. $zip->addFile($file_to_add_path, utf8_safe($file_to_add->getFilename()));
複製代碼
改成
  1. $zip->addFile($file_to_add_path, iconv("UTF-8","big5",$file_to_add->getFilename()));
複製代碼

解壓縮檔名亂碼問題
1. 修改 fengoffice\application\controllers\FileController.class.php 2009行

  1. $this->upload_file(null, $e_name, $tmp_path, $members);
複製代碼
改成
  1. $this->upload_file(null, iconv("big5","UTF-8",$e_name), $tmp_path, $members);
複製代碼
2. 將2000~2006行mark掉
  1. /*
  2. $e_name = preg_match_all('/([\x09\x0a\x0d\x20-\x7e]'. // ASCII characters
  3. '|[\xc2-\xdf][\x80-\xbf]'. // 2-byte (except overly longs)
  4. '|\xe0[\xa0-\xbf][\x80-\xbf]'. // 3 byte (except overly longs)
  5. '|[\xe1-\xec\xee\xef][\x80-\xbf]{2}'. // 3 byte (except overly longs)
  6. '|\xed[\x80-\x9f][\x80-\xbf])+/', // 3 byte (except UTF-16 surrogates)
  7. $e_name, $clean_pieces);

  8. $e_name = join('?', $clean_pieces[0]);
  9. */

複製代碼


您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-4-23 21:42 , Processed in 0.015764 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表