;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages
;; Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004,
-;; 2005 Free Software Foundation, Inc.
+;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
(memq 'gnus-all mail-parse-ignored-charsets)
(memq charset mail-parse-ignored-charsets))
(setq charset mail-parse-charset))
- (let ((cs (mm-coding-system-p (mm-charset-to-coding-system charset))))
+ (let ((cs (mm-charset-to-coding-system charset)))
(cond ((eq cs 'ascii)
(setq cs (or (mm-charset-to-coding-system mail-parse-charset)
'raw-text)))
- (cs)
+ ((setq cs (mm-coding-system-p cs)))
((and charset
(listp mail-parse-ignored-charsets)
(memq 'gnus-unknown mail-parse-ignored-charsets))
((char-equal ?Q (nth 1 word))
(setq text (quoted-printable-decode-string
(mm-subst-char-in-string
- ?_ ? (nth 2 word) t)))))
+ ?_ ? (nth 2 word) t)))))
(error
(message "%s" (error-message-string code))
nil)))
(push (cons cs text) rest))
;; Don't decode encoded-word.
(push (cons nil (nth 3 word)) rest)))
- (setq words "")
(while rest
(setq words (concat
(or (and (setq cs (caar rest))
nil)))
(concat (when (cdr rest) " ")
(cdar rest)
- (unless (string-equal words "") " ")))
+ (when (and words
+ (not (eq (string-to-char words) ? )))
+ " ")))
words)
rest (cdr rest)))
words))