[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to change encoding temporarily?
From: |
Brep |
Subject: |
Re: How to change encoding temporarily? |
Date: |
Fri, 17 Nov 2006 23:53:51 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/23.0.0 (windows-nt) Hamster/2.1.0.11 |
ssSslang <sssslang@163.com.removeme> writes:
> Thank you, Reiner. I saw these hooks, but they're not related to mail
> address. Do you mean I should write a function to select the encoding
> according to the From header, and then bind it to the hook?
Try this:
(add-hook 'message-send-hook 'change-charset)
(defun change-charset ()
(when (message-mail-p)
(if (string-match "hotmail" (mail-fetch-field "to"))
(setq mm-coding-system-priorities
'(iso-8859-1 gbk utf-8))
(setq mm-coding-system-priorities
'(iso-8859-1 utf-8)))))