Call set_my_charset() before actually using , and fix variable name in case != iso...
authoralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Jul 2003 12:47:06 +0000 (12:47 +0000)
committeralex-brainstorm <alex-brainstorm@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Jul 2003 12:47:06 +0000 (12:47 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5365 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_utf7_local.php

index eb5db9c43b84e68266db0d48a8c906de5fc69be6..7f56d606eed05e532f1a33070cd8e290dfcb564d 100644 (file)
@@ -20,8 +20,7 @@ function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default
        stristr('utf-8',$default_charset) || 
        stristr('iso-2022-jp',$default_charset) ) {
     if (function_exists('mb_convert_encoding')) {
-      set_my_charset();
-      return mb_convert_encoding($s, $to_encoding, $from_encoding);
+      return mb_convert_encoding($str, $to_encoding, $from_encoding);
     }
   }
   return '';
@@ -39,6 +38,7 @@ function imap_utf7_encode_local($s) {
       return '';
 
     global $default_charset;
+    set_my_charset();
     if (strtolower($default_charset) != 'iso-8859-1') {
       $utf7_s = sqimap_mb_convert_encoding($s, 'UTF7-IMAP', $default_charset, $default_charset);
       if ($utf7_s != '')
@@ -91,6 +91,7 @@ function imap_utf7_decode_local($s) {
       return '';
 
     global $default_charset;
+    set_my_charset();
     if (strtolower($default_charset) != 'iso-8859-1') {
       $utf7_s = sqimap_mb_convert_encoding($s, $default_charset, 'UTF7-IMAP', $default_charset);
       if ($utf7_s != '')