summaryrefslogtreecommitdiff
path: root/program/lib/imap.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-10-21 12:12:23 +0000
committerthomascube <thomas@roundcube.net>2005-10-21 12:12:23 +0000
commita95e0e174c48b7c5242b8969aef99838a52c41ee (patch)
treeeb87cb9c33433269d2f2376e841e1d6d66eff667 /program/lib/imap.inc
parent7902df457d3401c83f78a6ddd48df1a7f07f68b1 (diff)
Improved support for UTF-8 and other charsets
Diffstat (limited to 'program/lib/imap.inc')
-rw-r--r--program/lib/imap.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 22757ba82..3d37bed17 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -1239,8 +1239,13 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
$result[$id]->cc = str_replace("\n", " ", $headers["cc"]);
$result[$id]->encoding = str_replace("\n", " ", $headers["content-transfer-encoding"]);
$result[$id]->ctype = str_replace("\n", " ", $headers["content-type"]);
- //$result[$id]->in_reply_to = ereg_replace("[\n<>]",'', $headers['in-reply-to']);
- list($result[$id]->ctype,$foo) = explode(";", $headers["content-type"]);
+ $result[$id]->in_reply_to = ereg_replace("[\n<>]",'', $headers['in-reply-to']);
+
+ list($result[$id]->ctype, $ctype_add) = explode(";", $headers["content-type"]);
+
+ if (preg_match('/charset="?([a-z0-9\-]+)"?/i', $ctype_add, $regs))
+ $result[$id]->charset = $regs[1];
+
$messageID = $headers["message-id"];
if ($messageID) $messageID = substr(substr($messageID, 1), 0, strlen($messageID)-2);
else $messageID = "mid:".$id;