* eword-encode.el (make-ew-rword, ew-rword-text, ew-rword-charset)
[elisp/flim.git] / mime.el
diff --git a/mime.el b/mime.el
index 56bdb1b..9dc2fcc 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -1,6 +1,6 @@
 ;;; mime.el --- MIME library module
 
-;; Copyright (C) 1998,1999,2000 Free Software Foundation, Inc.
+;; Copyright (C) 1998,1999,2000,2001,2003 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;; Keywords: MIME, multimedia, mail, news
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Code:
 
@@ -332,7 +332,7 @@ default value."
                 (prog1
                     field-name
                   (setq field-name (symbol-name field-name)))
-              (intern (capitalize (capitalize field-name))))))
+              (intern (capitalize field-name)))))
     (cond ((eq sym 'Content-Type)
           (mime-entity-content-type entity)
           )
@@ -391,13 +391,16 @@ default value."
 (defun mime-entity-filename (entity)
   "Return filename of ENTITY."
   (or (mime-entity-uu-filename entity)
-      (mime-content-disposition-filename
-       (mime-entity-content-disposition entity))
+      (let ((ret (mime-content-disposition-filename
+                 (mime-entity-content-disposition entity))))
+       (if (and mime-header-accept-quoted-encoded-words
+                ret)
+           (eword-decode-string ret)
+         ret))
       (cdr (let ((param (mime-content-type-parameters
                         (mime-entity-content-type entity))))
             (or (assoc "name" param)
-                (assoc "x-name" param))
-            ))))
+                (assoc "x-name" param))))))
 
 
 (defsubst mime-entity-media-type (entity)