From c41245c6b9fdaa91dadbf9f1a77c85300aa2fc61 Mon Sep 17 00:00:00 2001 From: alex-brainstorm Date: Mon, 21 Jul 2003 12:47:06 +0000 Subject: [PATCH] Call set_my_charset() before actually using , and fix variable name in case != iso-8859-1, all pointed out by Tomas ;) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5365 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_utf7_local.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/imap_utf7_local.php b/functions/imap_utf7_local.php index eb5db9c4..7f56d606 100644 --- a/functions/imap_utf7_local.php +++ b/functions/imap_utf7_local.php @@ -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 != '') -- 2.25.1