From bdab4b7f03e32c5440465f01d0a3777298c986b1 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:04:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=9C=E7=A8=8B=E7=BC=96?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 8bc7cbde..21462e41 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,9 +151,11 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode = mb_detect_encoding($f, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5')); - $_f = mb_convert_encoding ($f, 'UTF-8', 'GBK'); - $_dir = mb_convert_encoding ($dir, 'UTF-8', 'GBK'); + $encode_f = mb_detect_encoding($f, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_f = mb_convert_encoding ($f, 'UTF-8', $encode_f); + $encode_d = mb_detect_encoding($dir, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_dir = mb_convert_encoding ($dir, 'UTF-8', $encode_d); + echo($encode_f.'@@@'.$encode_d); $file_temp = str_replace('/index.htm###', '', $_f.'###'); $file_temp = str_replace('###', '', $file_temp);