summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-10-18 09:33:49 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2007-10-18 09:33:49 +0000
commitb5a1e9f651675d01fdaa190b62f22481f5136ab1 (patch)
tree2daf937210a19f9acafbc517ca07ceb375dbd3ec /roundcubemail/program/include
parentd50abe55e1fd41f01dbb728ac6e433db613564b9 (diff)
Add support for Korean charset (KS_C_5601)
git-svn-id: https://svn.roundcube.net/trunk@885 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/main.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 5a47242e3..b940e2a13 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -1077,16 +1077,18 @@ function rcube_charset_convert($str, $from, $to=NULL)
// convert charset using iconv module
if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7')
- return iconv($from, $to . "//IGNORE", $str);
+ {
+ $iconv_map = array('KS_C_5601-1987' => 'EUC-KR');
+ return iconv(($iconv_map[$from] ? $iconv_map[$from] : $from), ($iconv_map[$to] ? $iconv_map[$to] : $to) . "//IGNORE", $str);
+ }
// convert charset using mbstring module
if ($MBSTRING)
{
- $to = $to=="UTF-7" ? "UTF7-IMAP" : $to;
- $from = $from=="UTF-7" ? "UTF7-IMAP": $from;
+ $mb_map = array('UTF-7' => 'UTF7-IMAP', 'KS_C_5601-1987' => 'EUC-KR');
// return if convert succeeded
- if (($out = mb_convert_encoding($str, $to, $from)) != '')
+ if (($out = mb_convert_encoding($str, ($mb_map[$to] ? $mb_map[$to] : $to), ($mb_map[$from] ? $mb_map[$from] : $from))) != '')
return $out;
}