[Mew-dist 03775] Re: displaying content-type and parameters for binaries

SAKAI Kiyotaka ksakai at example.com
1998年 2月 16日 (月) 15:55:39 JST


>> In article <19980216145045W.yoko-a at example.com>, Atsushi Yokoyama <yoko-a at example.com> writes:

> Lotus Notes Mailの SMTPゲートウェイでは、nameパラメータをエンコードし
> ています。"エクセル.xls"というファイルを添付すると、下のようなMIMEヘッ
> ダがつきます。

> Content-type: application/octet-stream; 
> 	name="=?iso-2022-jp?B?GyRCJSglLyU7JWsbKEIueGxz?="
> Content-transfer-encoding: base64

普通に B encode されるのですね。

こんな感じでどうでしょうか。
-- 
酒井 清隆 (E-mail: ksakai at example.com)


Index: mew-bq.el
===================================================================
RCS file: /home/cvsroot/mew-1.93b13/mew-bq.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 mew-bq.el
--- mew-bq.el	1998/02/13 00:22:52	1.1.1.1
+++ mew-bq.el	1998/02/16 06:47:28
@@ -580,6 +580,22 @@
     (replace-match (mew-match 1) nil t))
   )
 
+(defun mew-header-decode-string (str)
+  (let (c1 c2 c3 c4 charset b-or-q cs-str)
+    (setq c1 (string-match "=\\?" str))
+    (if c1 (setq c2 (string-match "\\?" str (+ c1 2))))
+    (if c2 (setq c3 (string-match "\\?" str (+ c2 1))))
+    (if c3 (setq c4 (string-match "\\?=" str (+ c3 1))))
+    (if c4
+	(progn
+	  (setq charset (substring str (+ c1 2) c2))
+	  (setq b-or-q (substring str (1+ c2) c3))
+	  (setq cs-str (substring str (1+ c3) c4))
+	  (concat (substring str 0 c1)
+		  (mew-header-decode charset b-or-q cs-str)
+		  (mew-header-decode-string (substring str (+ c4 2)))))
+      str)))
+
 (provide 'mew-bq)
 
 ;;; Copyright Notice:
Index: mew-mime.el
===================================================================
RCS file: /home/cvsroot/mew-1.93b13/mew-mime.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 mew-mime.el
--- mew-mime.el	1998/02/13 00:22:53	1.1.1.1
+++ mew-mime.el	1998/02/16 06:51:40
@@ -209,7 +209,8 @@
 	    "\n\n"
 	    (format "Content-Type:\t%s\n" ct)
 	    (if params
-		(format "Params:\t\t%s\n" (mapconcat 'concat params "; "))
+		(format "Params:\t\t%s\n"
+			(mapconcat 'mew-header-decode-string params "; "))
 	      "")
 	    (format "Size:\t\t%d bytes\n" size)
 	    "\nTo save this part, type "



Mew-dist メーリングリストの案内