From e4a256af2e1a80cddbbbd200ed68f7ea43c89a60 Mon Sep 17 00:00:00 2001 From: gustavf Date: Mon, 10 Jul 2000 14:24:56 +0000 Subject: [PATCH] Charset and encoding support is now working again :-) git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@609 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/i18n.php | 4 ++++ functions/mime.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/functions/i18n.php b/functions/i18n.php index 23822193..30894d01 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -26,11 +26,15 @@ // Decodes a string to the internal encoding from the given charset function charset_decode ($charset, $string) { + global $debug_mime; + // All HTML special characters are 7 bit and can be replaced first $string = htmlspecialchars ($string); $charset = strtolower($charset); + if ($debug_mime) $string = $charset.":".$string; + if (ereg("iso-8859-(.*)", $charset, $res)) { if ($res[1] == "1") return charset_decode_iso_8859_1 ($string); diff --git a/functions/mime.php b/functions/mime.php index fecaac8e..701cea85 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -26,7 +26,7 @@ var $type0, $type1, $boundary, $charset, $encoding; var $to, $from, $date, $cc, $bcc, $reply_to, $subject; var $id, $mailbox, $description; - var $entity_id, $message_id; + var $entity_id, $message_id, $charset; } class message { @@ -255,6 +255,7 @@ if ($debug_mime) echo "".$properties[$i]["name"]." = " . $properties[$i]["value"] . "
"; } } + return $msg; } @@ -426,7 +427,10 @@ $id = $message->header->id; $urlmailbox = urlencode($message->header->mailbox); + // Get the right entity and redefine message to be this entity $ent_num = findDisplayEntity ($message); + $message = getEntity($message, $ent_num); + $body = mime_fetch_body ($imap_stream, $id, $ent_num); $body = decodeBody($body, $message->header->encoding); -- 2.25.1