From 6c387a30478442ffaafffb413f7fd7360accef10 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 8 Dec 2020 15:14:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=8E=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/cache.php | 10 ++-------- application/views/cache/update.php | 11 +++++++---- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 6cc027ca..2f7af7dd 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -151,15 +151,9 @@ class Cache extends CI_Controller { if ($f!='.' && $f!='..' && (strpos($dir, '/cn/')===false) && (strpos($dir, '/amp/')===false) && (strpos($f, '.pdf')===false)) { - $encode_f = mb_detect_encoding($f); - $_f = mb_convert_encoding ($f, 'UTF-8', $encode_f); - $encode_d = mb_detect_encoding($dir); - $_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('/index.htm###', '', $f.'###'); $file_temp = str_replace('###', '', $file_temp); - $path_temp = str_replace($this->dir, '', $_dir); + $path_temp = str_replace($this->dir, '', $dir); $url_temp = $this->current_domain.$path_temp.'/'.$file_temp; $url_temp = str_replace('index.htm', '', $url_temp); $file_time[$url_temp] = date("F d Y H:i:s", filemtime("$dir/$f")); diff --git a/application/views/cache/update.php b/application/views/cache/update.php index ca6a6603..8b68924c 100644 --- a/application/views/cache/update.php +++ b/application/views/cache/update.php @@ -124,13 +124,16 @@ $(function() {
- $it) { ?> + $it) { + $encode = mb_detect_encoding($it, array('ASCII','UTF-8','GB2312','GBK','BIG5')); + $_it = mb_convert_encoding($it, 'utf-8', $encode); + ?>