(mime-entity-encoding): Add new optional argument `default-encoding';
authormorioka <morioka>
Fri, 3 Jul 1998 15:22:54 +0000 (15:22 +0000)
committermorioka <morioka>
Fri, 3 Jul 1998 15:22:54 +0000 (15:22 +0000)
set default encoding if Content-Transfer-Encoding field is not found.

mime.el

diff --git a/mime.el b/mime.el
index 9672dd8..7961592 100644 (file)
--- a/mime.el
+++ b/mime.el
@@ -215,14 +215,15 @@ ENTITY is used."
                 entity disposition)
                disposition))))))
 
-(defun mime-entity-encoding (entity)
+(defun mime-entity-encoding (entity &optional default-encoding)
   (or (mime-entity-encoding-internal entity)
-      (let ((ret (mime-fetch-field 'Content-Transfer-Encoding entity)))
-       (if ret
-           (let ((encoding (mime-parse-Content-Transfer-Encoding ret)))
-             (when encoding
-               (mime-entity-set-encoding-internal entity encoding)
-               encoding))))))
+      (let ((encoding
+            (or (let ((ret (mime-fetch-field
+                            'Content-Transfer-Encoding entity)))
+                  (and ret (mime-parse-Content-Transfer-Encoding ret)))
+                default-encoding "7bit")))
+       (mime-entity-set-encoding-internal entity encoding)
+       encoding)))
 
 (defun mime-read-field (field-name &optional entity)
   (or (symbolp field-name)