Tíquete #28825

Emacs23でutf-8なメールとファイル添付が両立できない

: 2012-06-22 08:18 Última Atualização: 2012-06-22 08:24

Relator:
Dono:
(Nenhum)
Estado:
Aberto
Componente:
(Nenhum)
Marcos:
(Nenhum)
Prioridade:
9 - Highest
Gravidade:
9 - Highest
Resolução:
Nenhum
Arquivo:
Nenhum

Details

Emacs23では内部的にUTF-8エンコードとなっているため、以下の設定でUTF-8エンコードのメールを送信できる。また、これによって①や~などの文字が送信できるようになる。

;; -*- Mode: Emacs-Lisp ; Coding: utf-8-unix -*-
(set-language-environment 'Japanese)
(prefer-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)

(require 'cp5022x)

;; SEMI (cf. http://d.hatena.ne.jp/kiwanami/20091103/1257243524)
(eval-after-load "mcs-20"

'(when (coding-system-p 'cp50220)
(add-to-list 'mime-charset-coding-system-alist

'(iso-2022-jp . cp50220))))

また、FLIMのmm-q-cc.elに以下のパッチを当てる。
--- mel-q-ccl.el~ 2006-06-12 15:10:02 +0000
+++ mel-q-ccl.el 2008-04-03 06:33:51 +0000
@@ -893,7 +893,13 @@

(defun quoted-printable-ccl-encode-region (start end)
"Encode the region from START to END with quoted-printable encoding."
(interactive "*r")

- (decode-coding-region start end 'mel-ccl-quoted-printable-lf-lf-rev))
+ (save-excursion
+ (goto-char start)
+ (insert (prog1
+ (decode-coding-string
+ (string-as-unibyte (buffer-substring start end))
+ 'mel-ccl-quoted-printable-lf-lf-rev)
+ (delete-region start end)))))

(defun quoted-printable-ccl-insert-encoded-file (filename)
"Encode contents of the file named as FILENAME, and insert it."

動作確認はWindows XP上およびUbuntu上のEmacs23で行った。

しかし、上記の設定を行った場合、添付ファイルが破壊され、再生不可能となることがある。
とりあえずの対処としては上記のdefadviceの設定をコメントアウトすることであるが、これによってUTF-8なメールが送れなくなる。

FLIMの問題であり、cmail固有の問題ではないと思われるが、SEMI/FLIMを使用しないで最近のEmacsのmail機能に標準搭載されているmime機能を活用することで、もしかしたら解決するかもしれない。

Emacsのmimeとのインターフェースを作成し、動作を確認する必要あり。

Ticket History (2/2 Histories)

2012-06-22 08:18 Updated by: yutopia
  • New Ticket "Emacs23でutf-8なメールとファイル添付が両立できない" created
2012-06-22 08:24 Updated by: yutopia
  • Prioridade Update from 5 - Medium to 9 - Highest
  • Gravidade Update from 8 to 9 - Highest

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login