Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: info-gnus-english@gnu.org
Subject: Re: recoding messages to latin1+html when posting to yahoo groups?
Date: Wed, 30 Jan 2008 11:15:34 +0900	[thread overview]
Message-ID: <b4mprvkhxdl.fsf@jpl.org> (raw)
In-Reply-To: <87sl0gekwl.fsf@varenne.domain.invalid>

>>>>> James Leifer wrote:

> I'm running Ubuntu gutsy with

>   Gnus v5.13

>   GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.0) of
>   2007-12-30 on iridium

> and happily editing French emails and documents in utf-8 which gnus
> handles beautifully for posting and reading.

> My problem is that when I distribute messages via the Yahoo groups
> mailing lists, all utf-8 accented characters get garbled.  I did several
> experiments with mm-content-transfer-encoding-defaults to see if base64,
> 8bit, or quoted-printable would be handled correctly by yahoo, with no
> success.  Yahoo only handles iso-8859-1.

[...]

> Is there any way to set a gnus hook that recodes a utf-8 email into
> latin1 plus html entities when sending to any address of the form
> .*@yahoogroupes.fr?  I know that the unix program recode can do this
> kind of thing, but I don't understand:

An easy way is to customize the `mm-coding-system-priorities'
variable so that Latin-1 may be most preferred when encoding
messages.  To do that:

(setq mm-coding-system-priorities '(iso-8859-1))

It affects all messages to send, but isn't it enough for you?
If you want it to affect only messages to send to yahoogroupes.fr,
there will be several ways.  Here is one of them:

(defadvice mml-to-mime (around prefer-latin1-in-yahoo-mails activate)
  "Prefer Latin1 when encoding messages sent to @yahoogroupes.fr."
  (let* ((recipients (message-options-get 'message-recipients))
	 (mm-coding-system-priorities
	  (if (and recipients
		   (string-match "@yahoogroupes\\.fr\\(?:,\\|\\'\\)"
				 recipients))
	      (cons 'iso-8859-1 mm-coding-system-priorities)
	    mm-coding-system-priorities)))
    ad-do-it))

To try it, evaluate this form or put it in your ~/.gnus.el file.
People might know the smart way better than this.  Anyone? ;-)

At any rate, please note that Gnus will use the charset that is
not Latin-1 if the message contains text which cannot be encoded
by it.

Regards,

  reply	other threads:[~2008-01-30  2:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29 15:00 James Leifer
2008-01-30  2:15 ` Katsumi Yamaoka [this message]
2008-01-30  9:05   ` James Leifer
2008-01-30 20:28     ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mprvkhxdl.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).