Charset and encoding support is now working again :-)
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 10 Jul 2000 14:24:56 +0000 (14:24 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 10 Jul 2000 14:24:56 +0000 (14:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@609 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php
functions/mime.php

index 238221936aef857c614a2fab3bd03ab2ee193e1b..30894d0115a49ba09d9f88c315195e25b623ed20 100644 (file)
 
    // 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);
index fecaac8e1edecc2d6d4a5e16898bd82051382b6f..701cea85127cb969e976766524f107b4cc66bfc8 100644 (file)
@@ -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 {
             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);