From e081cfd05b1440f26b074d1569808c06d54488a8 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 10 Sep 2018 01:48:57 +0900 Subject: [PATCH] Update string.utl.php --- helper/string.utl.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/helper/string.utl.php b/helper/string.utl.php index 15bf7bb..be3fb6d 100644 --- a/helper/string.utl.php +++ b/helper/string.utl.php @@ -27,22 +27,27 @@ if(!function_exists("parse_tel_number_kr")) { if(!function_exists("get_converted_string")) { function get_converted_string($str, $to_charset, $from_charset, $method="iconv") { $output = ""; + $result = false; switch($method) { case "iconv": if(function_exists("iconv")) { - $output = iconv($from_charset, $to_charset, $str); + $result = iconv($from_charset, $to_charset, $str); } break; case "mb": if(function_exists("mb_convert_encoding")) { - $output = mb_convert_encoding($str, $to_charset, $from_charset); + $result = mb_convert_encoding($str, $to_charset, $from_charset); } break; default: $output = $str; } + if($result) { + $output = $result; + } + return $output; } }