(mm-uu-dissect-text-parts): Decode content transfer encoding.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 23 Jan 2006 04:40:57 +0000 (04:40 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Mon, 23 Jan 2006 04:40:57 +0000 (04:40 +0000)
lisp/ChangeLog
lisp/mm-uu.el

index c65d654..0a62aee 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-23  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * mm-uu.el (mm-uu-dissect-text-parts): Decode content transfer
+       encoding.
+
 2006-01-20  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * message.el (message-tool-bar-zap-list, message-tool-bar)
index 9f09604..90627a3 100644 (file)
@@ -620,24 +620,32 @@ value of `mm-uu-text-plain-type'."
 
 (defun mm-uu-dissect-text-parts (handle)
   "Dissect text parts and put uu handles into HANDLE."
-  (let ((buffer (mm-handle-buffer handle))
-       (case-fold-search t)
-       type children)
+  (let ((buffer (mm-handle-buffer handle)))
     (cond ((stringp buffer)
           (mapc 'mm-uu-dissect-text-parts (cdr handle)))
          ((bufferp buffer)
-          (when (and (setq type (mm-handle-media-type handle))
-                     (stringp type)
-                     ;; Mutt still uses application/pgp even though
-                     ;; it has already been withdrawn.
-                     (string-match "\\`text/\\|\\`application/pgp\\'" type)
-                     (with-current-buffer buffer
-                       (setq children
-                             (mm-uu-dissect t (mm-handle-type handle)))))
-            (kill-buffer buffer)
-            (setcar handle (car children))
-            (setcdr handle (cdr children))
-            (mm-uu-dissect-text-parts handle)))
+          (let ((type (mm-handle-media-type handle))
+                (case-fold-search t) ;; string-match
+                encoding children)
+            (when (and
+                   (stringp type)
+                   ;; Mutt still uses application/pgp even though
+                   ;; it has already been withdrawn.
+                   (string-match "\\`text/\\|\\`application/pgp\\'" type)
+                   (setq children
+                         (with-current-buffer buffer
+                           (if (setq encoding (mm-handle-encoding handle))
+                               ;; Inherit the multibyteness of the `buffer'.
+                               (with-temp-buffer
+                                 (insert-buffer-substring buffer)
+                                 (mm-decode-content-transfer-encoding
+                                  encoding type)
+                                 (mm-uu-dissect t (mm-handle-type handle)))
+                             (mm-uu-dissect t (mm-handle-type handle))))))
+              (kill-buffer buffer)
+              (setcar handle (car children))
+              (setcdr handle (cdr children))
+              (mm-uu-dissect-text-parts handle))))
          (t
           (mapc 'mm-uu-dissect-text-parts handle)))))