From 9f3504543849ff72022a8b8ce1d589a3e986b5fe Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 3 Jul 1998 15:22:54 +0000 Subject: [PATCH] (mime-entity-encoding): Add new optional argument `default-encoding'; set default encoding if Content-Transfer-Encoding field is not found. --- mime.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mime.el b/mime.el index 9672dd8..7961592 100644 --- 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) -- 1.7.10.4