From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44661 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: utf-8 -> latin-X if possible Date: Sat, 04 May 2002 16:08:43 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1020521374 21807 127.0.0.1 (4 May 2002 14:09:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 4 May 2002 14:09:34 +0000 (UTC) Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1740EA-0005fc-00 for ; Sat, 04 May 2002 16:09:34 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1740Db-0000l0-00; Sat, 04 May 2002 09:08:59 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sat, 04 May 2002 09:09:13 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id JAA25537 for ; Sat, 4 May 2002 09:09:00 -0500 (CDT) Original-Received: (qmail 15761 invoked by alias); 4 May 2002 14:08:42 -0000 Original-Received: (qmail 15756 invoked from network); 4 May 2002 14:08:41 -0000 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net (HELO yxa.extundo.com) (217.13.230.178) by gnus.org with SMTP; 4 May 2002 14:08:41 -0000 Original-Received: from localhost.localdomain (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.3/8.12.3) with ESMTP id g44E8dQ4014668 for ; Sat, 4 May 2002 16:08:40 +0200 Original-To: ding@gnus.org In-Reply-To: (Simon Josefsson's message of "Sat, 04 May 2002 13:36:10 +0200") Mail-Copies-To: nobody Original-Lines: 108 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44661 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44661 (Talking to myself...) Simon Josefsson writes: > How do I get Gnus to send it using latin-X, if possible, instead? Emacs config to make it Unicode friendly: (prefer-coding-system 'utf-8) Gnus config to make it revert to iso-8859-1 when possible: '(mm-coding-system-priorities (quote (iso-latin-1))) > Wouldn't it be nice if there were a section explaining this stuff in > the manual? I'll write it when I get this to work the way I want. Yup. I changed the Emacs MIME manual to be a users manual, relevant sections included below. If someone who knows English and/or Mule reads it, please fix it. Encoding Customization ====================== `mm-body-charset-encoding-alist' Mapping from MIME charset to encoding to use. This variable is usually used except, e.g., when other requirements force a specific encoding (digitally signed messages require 7bit encodings). The default is `((iso-2022-jp . 7bit) (iso-2022-jp-2 . 7bit))'. As an example, if you do not want to have ISO-8859-1 characters quoted-printable encoded, you may add `(iso-8859-1 . 8bit)' to this variable. You can override this setting on a per-message basis by using the `encoding' MML tag (*note MML Definition::). `mm-coding-system-priorities' Prioritize coding systems to use for outgoing messages. The default is nil, which means to use the defaults in Emacs. It is a list of coding system symbols (aliases of coding systems does not work, use `M-x describe-coding-system' to make sure you are not specifying an alias in this variable). For example, if you have configured Emacs to use prefer UTF-8, but wish that outgoing messages should be sent in ISO-8859-1 if possible, you can set this variable to `(iso-latin-1)'. `mm-content-transfer-encoding-defaults' Mapping from MIME types to encoding to use. This variable is usually used except, e.g., when other requirements force a safer encoding (digitally signed messages require 7bit encoding). Besides the normal MIME encodings, `qp-or-base64' may be used to indicate that for each case the most efficient of quoted-printable and base64 should be used. You can override this setting on a per-message basis by using the `encoding' MML tag (*note MML Definition::). `mm-use-ultra-safe-encoding' When this is non-nil, it means that textual parts are encoded as quoted-printable if they contain lines longer than 76 characters or starting with "From " in the body. Non-7bit encodings (8bit, binary) are generally disallowed. This reduce the probability that a non-8bit clean MTA or MDA changes the message. This should never be set directly, but bound by other functions when necessary (e.g., when encoding messages that are to be digitally signed). Charset Translation =================== During translation from MML to MIME, for each MIME part which has been composed inside Emacs, an appropriate charset has to be chosen. If you are running a non-MULE Emacs, this process is simple: If the part contains any non-ASCII (8-bit) characters, the MIME charset given by `mail-parse-charset' (a symbol) is used. (Never set this variable directly, though. If you want to change the default charset, please consult the documentation of the package which you use to process MIME messages. *Note Various Message Variables: (message)Various Message Variables, for example.) If there are only ASCII characters, the MIME charset US-ASCII is used, of course. Things are slightly more complicated when running Emacs with MULE support. In this case, a list of the MULE charsets used in the part is obtained, and the MULE charsets are translated to MIME charsets by consulting the variable `mm-mime-mule-charset-alist'. If this results in a single MIME charset, this is used to encode the part. But if the resulting list of MIME charsets contains more than one element, two things can happen: If it is possible to encode the part via UTF-8, this charset is used. (For this, Emacs must support the `utf-8' coding system, and the part must consist entirely of characters which have Unicode counterparts.) If UTF-8 is not available for some reason, the part is split into several ones, so that each one can be encoded with a single MIME charset. The part can only be split at line boundaries, though--if more than one MIME charset is required to encode a single line, it is not possible to encode the part. When running Emacs with MULE support, the preferences for which coding system to use is inherited from Emacs itself. This means that if Emacs is set up to prefer UTF-8, it will be used when encoding messages. You can modify this by altering the `mm-coding-system-priorities' variable though (*note Encoding Customization::). The charset to be used can be overriden by setting the `charset' MML tag (*note MML Definition::) when composing the message. The encoding of characters (quoted-printable, 8bit etc) is orthogonal to the discussion here, and is controlled by the variables `mm-body-charset-encoding-alist' and `mm-content-transfer-encoding-defaults' (*note Encoding Customization::).