(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)))))