diff options
author | alecpl <alec@alec.pl> | 2009-03-01 08:14:14 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2009-03-01 08:14:14 +0000 |
commit | 65d71081907123fd5ecc81fa3bba659e7f45fe86 (patch) | |
tree | a94f3988f047665d500d7dc4d837ad5678b0e1b4 /program/include/main.inc | |
parent | d519ef8a0a24e5cfcc13f136047dcabb504e9c1d (diff) |
- Support 'UNICODE-1-1-UTF-7' alias for UTF-7 encoding (#1485758)
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 86fe578ca..9adcd4cfc 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -186,6 +186,12 @@ function rcube_charset_convert($str, $from, $to=NULL) $to = $to==NULL ? strtoupper(RCMAIL_CHARSET) : strtoupper($to); $error = false; $conv = null; + # RFC1642 + if ($from == 'UNICODE-1-1-UTF-7') + $from = 'UTF-7'; + if ($to == 'UNICODE-1-1-UTF-7') + $to = 'UTF-7'; + if ($from==$to || $str=='' || empty($from)) return $str; @@ -209,7 +215,6 @@ function rcube_charset_convert($str, $from, $to=NULL) } } - if (is_null($mbstring_loaded)) $mbstring_loaded = extension_loaded('mbstring'); @@ -232,8 +237,8 @@ function rcube_charset_convert($str, $from, $to=NULL) return $out; } } - - + + # try to convert with custom classes if (class_exists('utf8')) $conv = new utf8(); |