// 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);
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 {
if ($debug_mime) echo "<tt>".$properties[$i]["name"]." = " . $properties[$i]["value"] . "</tt><br>";
}
}
+
return $msg;
}
$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);