[Mew-dist 298] Re: multiple charsets
Murata Shuuichirou
mrt at example.com
1996年 12月 15日 (日) 20:22:10 JST
In message <19961214203745R.mrt at example.com>,
Murata Shuuichirou <mrt at example.com> wrote:
> > patch を眺めただけですが、header が internal code で出ていくので
> > はないでしょうか?
>
> うう、しまった。そのとおりです。
>
> > #自前で encode するにはちゃんとした RFC822 parser を書かなくちゃい
> > #けないのでちょっと面倒...
>
> はい、めんどうですね。めんどうなので手抜きで mew-mule-charset-header
> をつくって、ヘッダ全体をそれで encode するようにしてしまいました。
使う文字コードによっては正しく sign できなくなっていました。
--
むらたしゅういちろう
-------------- next part --------------
diff -ur mew-1.54+m24/mew-charset.el mew-1.54/mew-charset.el
--- mew-1.54+m24/mew-charset.el Fri Dec 13 18:10:15 1996
+++ mew-1.54/mew-charset.el Sat Dec 14 19:56:11 1996
@@ -133,8 +133,8 @@
(cond
(mew-mule24-p
- (defvar mew-mule-charset-mime-trans 'coding-system-iso-2022-ss2-7)
- (defvar mew-mule-charset-rfc822-trans 'coding-system-iso-2022-ss2-7)
+ (defvar mew-mule-charset-rfc822-trans 'coding-system-iso-2022-int-2)
+ (defvar mew-mule-charset-header 'coding-system-iso-2022-int-2)
(defvar mew-mule-charset-draft 'coding-system-iso-2022-jp)
(defvar mew-mule-charset-scan 'coding-system-iso-2022-jp)
;; coding-system-iso-2022-ss2-7
@@ -145,8 +145,8 @@
;; ^M as it is
)
(mew-mule-p
- (defvar mew-mule-charset-mime-trans *iso-2022-ss2-7*)
- (defvar mew-mule-charset-rfc822-trans *iso-2022-ss2-7*)
+ (defvar mew-mule-charset-rfc822-trans *iso-2022-int-1*)
+ (defvar mew-mule-charset-header *iso-2022-int-1*)
(defvar mew-mule-charset-draft *iso-2022-jp*)
(defvar mew-mule-charset-scan *iso-2022-jp*) ;; *iso-2022-ss2-7*
(defvar mew-mule-charset-spool *noconv*)
@@ -164,8 +164,7 @@
(list
(list mew-prog-inc 'process mew-mule-charset-scan)
(list mew-prog-scan 'process mew-mule-charset-scan)
- (list mew-prog-send 'process
- 'no-conversion mew-mule-charset-mime-trans)
+ (list mew-prog-send 'process 'no-conversion 'no-conversion)
(list mew-prog-pick 'process mew-mule-charset-scan)
(list mew-prog-mime-encode 'process 'no-conversion)
(list mew-prog-mime-decode 'process 'no-conversion)
@@ -175,8 +174,7 @@
(mew-mule-p
(define-program-coding-system nil mew-prog-inc mew-mule-charset-scan)
(define-program-coding-system nil mew-prog-scan mew-mule-charset-scan)
- (define-program-coding-system nil mew-prog-send
- (cons *noconv* mew-mule-charset-mime-trans))
+ (define-program-coding-system nil mew-prog-send (cons *noconv* *noconv*))
(define-program-coding-system nil mew-prog-pick mew-mule-charset-scan)
(define-program-coding-system nil mew-prog-mime-encode *noconv*)
(define-program-coding-system nil mew-prog-mime-decode *noconv*)
diff -ur mew-1.54+m24/mew-draft.el mew-1.54/mew-draft.el
--- mew-1.54+m24/mew-draft.el Fri Dec 13 18:10:15 1996
+++ mew-1.54/mew-draft.el Fri Dec 13 18:49:16 1996
@@ -549,8 +549,8 @@
(delete nil))
(set-buffer-modified-p t) ; Make sure buffer is written
(let ((file-coding-system
- (if (and mew-mule-p (not mew-mule24-p)) mew-mule-charset-mime-trans))
- (coding-system-for-write (if mew-mule24-p mew-mule-charset-mime-trans)))
+ (if (and mew-mule-p (not mew-mule24-p)) *noconv*))
+ (coding-system-for-write (if mew-mule24-p 'no-conversion)))
(save-buffer)
)
;; make backup folder(s)
diff -ur mew-1.54+m24/mew-encode.el mew-1.54/mew-encode.el
--- mew-1.54+m24/mew-encode.el Fri Dec 13 18:10:15 1996
+++ mew-1.54/mew-encode.el Sun Dec 15 19:56:14 1996
@@ -68,6 +68,11 @@
(re-search-forward "^-*$")
(beginning-of-line)
(setq mew-draft-buffer-header (point-marker)) ;; just in case
+ (cond (mew-mule24-p
+ (encode-coding-region (point-min) (point) mew-mule-charset-header) )
+ (mew-mule-p
+ (code-convert-region (point-min) (point)
+ *internal* mew-mule-charset-header) ))
))
(defun mew-draft-make-single ()
@@ -217,7 +222,18 @@
;; Probably 7bit text based object like phantom body of
;; message/external-body. file-coding-system-for-read is not
;; necessary.
- (insert-file-contents file)))
+ (let ((file-coding-system-for-read
+ (if (and mew-mule-p (not mew-mule24-p)) *noconv*) )
+ (coding-system-for-read
+ (if mew-mule24-p 'no-conversion) ))
+ (insert-file-contents file) )))
+ (let ((charsym (if (and charset mew-mule-p)
+ (mew-charset-to-symbol charset))))
+ (and charsym
+ (cond (mew-mule24-p
+ (encode-coding-region beg (point-max) charsym))
+ (mew-mule-p
+ (code-convert-region beg (point-max) *internal* charsym) ))))
;; Go to RFC1847 privacy services.
;; RFC1847 and services using it such as RFC1848 MOSS and Elkins PGP/MIME
;; allows 8bit/binary MIME canonical form(i.e. 7bit content-header and
diff -ur mew-1.54+m24/mew-pgp.el mew-1.54/mew-pgp.el
--- mew-1.54+m24/mew-pgp.el Fri Dec 13 18:10:14 1996
+++ mew-1.54/mew-pgp.el Sat Dec 14 20:28:36 1996
@@ -371,6 +371,12 @@
(re-search-forward "^-*$")
(beginning-of-line)
(setq mew-draft-buffer-header (point-marker)) ;; just in case
+ (cond (mew-mule24-p
+ (encode-coding-region (point-min) (point)
+ mew-mule-charset-header) )
+ (mew-mule-p
+ (code-convert-region (point-min) (point)
+ *internal* mew-mule-charset-header) ))
))
))
Mew-dist メーリングリストの案内