2005-03 / 2005-03-03

前のエントリ: 携帯端末 スペック 端末情報 [携帯]
次のエントリ: wanderlust サマリでマルチパートメールの横に'@'マーク [wanderlust]

日本語の添付ファイルの表示
2005-03-03-5 / カテゴリ: [linux][wanderlust] / [permlink]

http://www.kakutani.com/20040422.html
;;日本語の添付ファイル名を正しく表示
;;これがないと化けます.
(defvar my-mime-filename-coding-system-for-decode
  '(iso-2022-jp japanese-shift-jis japanese-iso-8bit))
(defun my-mime-decode-filename (filename)
  (let ((rest (eword-decode-string filename)))
    (or (when (and my-mime-filename-coding-system-for-decode
                   (string= rest filename))
          (let ((dcs (mapcar (function coding-system-base)
                             (detect-coding-string filename))))
            (unless (memq 'emacs-mule dcs)
              (let ((pcs my-mime-filename-coding-system-for-decode))
                (while pcs
                  (if (memq (coding-system-base (car pcs)) dcs)
                      (setq rest (decode-coding-string filename (car pcs))
                            pcs nil)
                    (setq pcs (cdr pcs))))))))
        rest)))

(eval-after-load "mime"
  '(defadvice mime-entity-filename (after eword-decode-for-broken-MUA activate)
     "Decode encoded file name for BROKEN MUA."
     (when (stringp ad-return-value)
       (setq ad-return-value (my-mime-decode-filename ad-return-value)))))
(require 'std11)

;; ファイル名が日本語の添付ファイルをエンコードする [semi-gnus-ja: 6046]
(eval-after-load "std11"
  '(defadvice std11-wrap-as-quoted-string 
     (before encode-string activate)
     "Encode a string."
   (require 'eword-encode)
   (ad-set-arg 0 (eword-encode-string (ad-get-arg 0)))))
... こっちのほうが良いかも (↑asciiのみの添付ファイル名が表示できない…)
http://emacs-21.ki.nu/application/wl.html
前のエントリ: 携帯端末 スペック 端末情報 [携帯]
次のエントリ: wanderlust サマリでマルチパートメールの横に'@'マーク [wanderlust]

2013 : 01 02 03 04 05 06 07 08 09 10 11 12
2012 : 01 02 03 04 05 06 07 08 09 10 11 12
2011 : 01 02 03 04 05 06 07 08 09 10 11 12
2010 : 01 02 03 04 05 06 07 08 09 10 11 12
2009 : 01 02 03 04 05 06 07 08 09 10 11 12
2008 : 01 02 03 04 05 06 07 08 09 10 11 12
2007 : 01 02 03 04 05 06 07 08 09 10 11 12
2006 : 01 02 03 04 05 06 07 08 09 10 11 12
2005 : 01 02 03 04 05 06 07 08 09 10 11 12
2004 : 01 02 03 04 05 06 07 08 09 10 11 12

最終更新時間: 2013-05-02 16:12