From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/40233 Path: main.gmane.org!not-for-mail From: Mike Fabian Newsgroups: gmane.emacs.gnus.general Subject: How to use UTF-8 for outgoing mail with XEmacs? Date: Tue, 13 Nov 2001 00:05:44 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: References: Reply-To: mfabian@suse.de NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035175815 32264 80.91.224.250 (21 Oct 2002 04:50:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:50:15 +0000 (UTC) Return-Path: Original-Received: (qmail 27609 invoked from network); 12 Nov 2001 23:07:32 -0000 Original-Received: from malifon.math.uh.edu (129.7.128.13) by mastaler.com with SMTP; 12 Nov 2001 23:07:32 -0000 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 163Q9v-0002Vb-00; Mon, 12 Nov 2001 17:06:31 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 12 Nov 2001 17:06:13 -0600 (CST) 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 RAA19569 for ; Mon, 12 Nov 2001 17:05:59 -0600 (CST) Original-Received: (qmail 27532 invoked by alias); 12 Nov 2001 23:06:03 -0000 Original-Received: (qmail 27527 invoked from network); 12 Nov 2001 23:06:03 -0000 Original-Received: from ns.suse.de (HELO Cantor.suse.de) (213.95.15.193) by gnus.org with SMTP; 12 Nov 2001 23:06:03 -0000 Original-Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id BA72B1E8FC for ; Tue, 13 Nov 2001 00:05:47 +0100 (MET) Original-To: ding@gnus.org X-Face: "';oPz9V1+<,`}1ZuxRv~EiSusWq*{Yjr"Sdvbhq'?q=2R\\6Y9O/,SAE`{J|6I=|w/sQg< rW_N'E3IV6~f8?\l#Es`]S`mv',PY(`8{$$R?+gLu}Qv/Mn>)?uladFjJ@yl!_p_Jh;5QxlD6zL:?r IXe4FfK$C^mWhh$o`yt;.r.FLZLQOWBt> (prj@po.cwru.edu's message of "Mon, 12 Nov 2001 17:22:00 -0500") Original-Lines: 59 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Artificial Intelligence, i386-suse-linux) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:40233 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:40233 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable mm-util.el contains the following function: (defun mm-find-mime-charset-region (b e &optional hack-charsets) "Return the MIME charsets needed to encode the region between B and E. Nil means ASCII, a single-element list represents an appropriate MIME charset, and a longer list means no appropriate charset." (let (charsets) ;; The return possibilities of this function are a mess... (or (and (mm-multibyte-p) (fboundp 'find-coding-systems-region) ;; Find the mime-charset of the most preferred coding ;; system that has one. (let ((systems (find-coding-systems-region b e))) ;; Fixme: The `mime-charset' (`x-ctext') of `compound-te= xt' ;; is not in the IANA list. (setq systems (delq 'compound-text systems)) (unless (equal systems '(undecided)) (while systems (let ((cs (coding-system-get (pop systems) 'mime-cha= rset))) (if cs (setq systems nil charsets (list cs)))))) charsets)) ;; Otherwise we're not multibyte, XEmacs or a single coding ;; system won't cover it. (setq charsets=20 (mm-delete-duplicates (mapcar 'mm-mime-charset (delq 'ascii (mm-find-charset-region b e)))))) (if (and (memq 'iso-8859-15 charsets) (memq 'iso-8859-15 hack-charsets) (save-excursion (mm-iso-8859-x-to-15-region b e))) (mapcar (lambda (x) (setq charsets (delq (car x) charsets))) mm-iso-8859-15-compatible)) (if (and (memq 'iso-2022-jp-2 charsets) (memq 'iso-2022-jp-2 hack-charsets)) (setq charsets (delq 'iso-2022-jp charsets))) charsets)) How do do something like 'find-coding-systems-region' with XEmacs? As XEmacs doesn't have this function, only the second part of the 'or' is used with XEmacs. The result is that UTF-8 is never used, although XEmacs works fine with UTF-8 together with Mule-UCS (I add a German umlaut here to force this message to use UTF-8: '=F6'). I applied the following small patch to mm-util.el to make it possible to use UTF-8 in outgoing mail with XEmacs and Mule-UCS --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=mm-util.el.patch Index: mm-util.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mm-util.el,v retrieving revision 6.32 diff -u -r6.32 mm-util.el --- mm-util.el 2001/11/02 22:32:30 6.32 +++ mm-util.el 2001/11/12 22:59:23 @@ -508,7 +508,9 @@ (if (and (memq 'iso-2022-jp-2 charsets) (memq 'iso-2022-jp-2 hack-charsets)) (setq charsets (delq 'iso-2022-jp charsets))) - charsets)) + (if (> (length charsets) 1) + '(utf-8) + charsets))) (defmacro mm-with-unibyte-buffer (&rest forms) "Create a temporary buffer, and evaluate FORMS there like `progn'. --=-=-= Content-Type: text/plain; charset=iso-2022-jp This 'works for me' but it doesn't look quite right. What is the proper solution to this problem? -- Mike Fabian http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。 --=-=-=--