Gnus development mailing list
 help / color / mirror / Atom feed
From: Mike Fabian <mfabian@suse.de>
Subject: How to use UTF-8 for outgoing mail with XEmacs?
Date: Tue, 13 Nov 2001 00:05:44 +0100	[thread overview]
Message-ID: <s3tg07j7fp3.fsf_-_@gregory.suse.de> (raw)
In-Reply-To: <m3n11r1vfl.fsf@multivac.cwru.edu> (prj@po.cwru.edu's message of "Mon, 12 Nov 2001 17:22:00 -0500")

[-- Attachment #1: Type: text/plain, Size: 2519 bytes --]

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-text'
                   ;; 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-charset)))
                         (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 
                  (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: 'ö').

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mm-util.el.patch --]
[-- Type: text/x-patch, Size: 621 bytes --]

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'.

[-- Attachment #3: Type: text/plain, Size: 200 bytes --]


This 'works for me' but it doesn't look quite right.

What is the proper solution to this problem?

-- 
Mike Fabian   <mfabian@suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。

  reply	other threads:[~2001-11-12 23:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-12 11:46 Semi-recent addition - mailto local groups Harry Putnam
2001-11-12 22:22 ` Paul Jarc
2001-11-12 23:05   ` Mike Fabian [this message]
2001-12-29  5:05     ` How to use UTF-8 for outgoing mail with XEmacs? Lars Magne Ingebrigtsen
2001-12-29 11:46       ` Florian Weimer
2001-12-29 11:35         ` Lars Magne Ingebrigtsen
2001-12-29 16:15           ` Florian Weimer
2001-11-13 10:04   ` Semi-recent addition - mailto local groups Kai Großjohann
2001-11-13 16:44     ` Paul Jarc
2001-11-17 11:19       ` Simon Josefsson
2001-11-18 18:15         ` Amos Gouaux
2001-11-20  2:12         ` Paul Jarc
2001-11-20 19:04           ` Simon Josefsson
2001-11-24  5:46             ` Paul Jarc
2001-11-24 10:57               ` Simon Josefsson
2001-11-24 20:30                 ` Kai Großjohann
2001-11-25  1:01                 ` Paul Jarc
2001-11-25 11:36                   ` Simon Josefsson

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=s3tg07j7fp3.fsf_-_@gregory.suse.de \
    --to=mfabian@suse.de \
    /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).