From 65d71081907123fd5ecc81fa3bba659e7f45fe86 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Sun, 01 Mar 2009 03:14:14 -0500
Subject: [PATCH] - Support 'UNICODE-1-1-UTF-7' alias for UTF-7 encoding (#1485758)

---
 CHANGELOG                |    1 +
 program/include/main.inc |   11 ++++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 9a6b572..e1d64eb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,7 @@
 2009/03/01 (alec)
 ----------
 - Fix attaching more than nine inline images (#1485759)
+- Support 'UNICODE-1-1-UTF-7' alias for UTF-7 encoding (#1485758)
 
 2009/02/27 (thomasb)
 ----------
diff --git a/program/include/main.inc b/program/include/main.inc
index 86fe578..9adcd4c 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -186,6 +186,12 @@
   $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 @@
     }
   }
 
-
   if (is_null($mbstring_loaded))
     $mbstring_loaded = extension_loaded('mbstring');
     
@@ -232,8 +237,8 @@
         return $out;
     }
   }
-    
-  
+
+  # try to convert with custom classes
   if (class_exists('utf8'))
     $conv = new utf8();
 

--
Gitblit v1.9.1