From c755a6b0b32b58c86989e5c6cfd8085732b1e497 Mon Sep 17 00:00:00 2001 From: ytetsuro Date: Thu, 1 Feb 2018 11:50:36 +0900 Subject: refactor use Utf8 class --- system/helpers/download_helper.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php index 93d468421..a169c3fd5 100644 --- a/system/helpers/download_helper.php +++ b/system/helpers/download_helper.php @@ -151,13 +151,10 @@ if ( ! function_exists('force_download')) $encoding = config_item('charset'); if (strtoupper($encoding) !== 'UTF-8') { - if (MB_ENABLED) + $CI =& get_instance(); + if ($converted_filename = $CI->utf8->convert_to_utf8($utf8_filename, $encoding) ) { - $utf8_filename = mb_convert_encoding($utf8_filename, 'UTF-8', $encoding); - } - elseif (ICONV_ENABLED) - { - $utf8_filename = @iconv($encoding, 'UTF-8', $utf8_filename); + $utf8_filename = $converted_filename; } } -- cgit v1.2.3-24-g4f1b