X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=eword-decode.el;h=311e080e6793bab663ed4e13fb2fb1ad5a151782;hb=689d672292b79fa00f490d1da3e24da18335f6b3;hp=328cc28536246d6d6e646a0d497463c83aa7c906;hpb=19065081c8222a78c5352b5cf3f913ad08a29e72;p=elisp%2Fflim.git diff --git a/eword-decode.el b/eword-decode.el index 328cc28..311e080 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -1,6 +1,6 @@ ;;; eword-decode.el --- RFC 2047 based encoded-word decoder for GNU Emacs -;; Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99,2000,01,03,04 Free Software Foundation, Inc. ;; Author: ENAMI Tsugutomo ;; MORIOKA Tomohiko @@ -578,13 +578,15 @@ as a version of Net$cape)." (when dest (setq dest (decode-mime-charset-string dest charset)) (when must-unfold - (mapconcat - (function - (lambda (chr) - (cond ((eq chr ?\n) "") - ((eq chr ?\t) " ") - (t (char-to-string chr))))) - (std11-unfold-string dest) "")) + (setq dest + (mapconcat + (function + (lambda (chr) + (cond ((eq chr ?\n) "") + ((eq chr ?\r) "") + ((eq chr ?\t) " ") + (t (char-to-string chr))))) + (std11-unfold-string dest) ""))) (when language (put-text-property 0 (length dest) 'mime-language language dest)) dest)))) @@ -621,16 +623,17 @@ returns nil, next function is used. Otherwise the return value will be the result.") (defun eword-analyze-quoted-string (string start &optional must-unfold) - (let ((p (std11-check-enclosure string ?\" ?\" nil start))) - (if p - (cons (cons 'quoted-string - (decode-mime-charset-string - (std11-strip-quoted-pair - (substring string (1+ start) (1- p))) - default-mime-charset)) - ;;(substring string p)) - p) - ))) + (let ((p (std11-check-enclosure string ?\" ?\" nil start)) + ret) + (when p + (setq ret (decode-mime-charset-string + (std11-strip-quoted-pair + (substring string (1+ start) (1- p))) + default-mime-charset)) + (if mime-header-accept-quoted-encoded-words + (setq ret (eword-decode-string ret))) + (cons (cons 'quoted-string ret) + p)))) (defun eword-analyze-domain-literal (string start &optional must-unfold) (std11-analyze-domain-literal string start))