Gnus development mailing list
 help / color / mirror / Atom feed
From: Kenichi Handa <handa@ni.aist.go.jp>
To: Reiner Steib <Reiner.Steib@gmx.de>
Cc: jasonr@gnu.org, topia@clovery.jp, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: imap.el: international/utf-7.el vs. gnus/utf7.el (was: 23.0.50; utf7-decode failed with non latin-1 charactor)
Date: Wed, 07 Nov 2007 09:36:30 +0900	[thread overview]
Message-ID: <E1IpYuE-0001U7-MY@etlken.m17n.org> (raw)
In-Reply-To: <v9prynjgm3.fsf_-_@marauder.physik.uni-ulm.de> (message from Reiner Steib on Tue, 06 Nov 2007 20:53:08 +0100)

In article <v9prynjgm3.fsf_-_@marauder.physik.uni-ulm.de>, Reiner Steib <reinersteib+gmane@imap.cc> writes:

> > I think the right thing is to uncomment all codes for
> > utf-7-map in utf-7.el, and modify gnus to use normal
> > encode/decode-coding-region/string with utf-7-imap.
> >
> > I've just committed the former change.  

> AFAIKS, `utf-7-encode' also accepts that FROM is a string, but it's
> not documented.  Can we rely on this?  Could you document it, please?

No, don't use utf-7-encode directly but use
encode-coding-string.

For instance, this:

> +(defun utf7-encode-NEW (string &optional for-imap)
> +  (with-temp-buffer
> +    ;; (utf-7-encode FROM TO IMAP)
> +    ;;
> +    ;; `utf-7-encode' also accepts that FROM is a string, but it's not
> +    ;; documented.
> +    (utf-7-encode string nil for-imap)
> +    (buffer-string)))

can simply be:

(defun utf7-encode-NEW (string &optional for-imap)
  (encode-coding-string string (if for-imap 'utf-7-imap 'utf-7)))

And the test for the availability is:

(and (coding-system-p 'utf-7) (coding-system-p 'utf-7-imap))

---
Kenichi Handa
handa@ni.aist.go.jp

  reply	other threads:[~2007-11-07  0:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87k5p1ho29.wl%topia@clovery.jp>
     [not found] ` <472B1AD5.3090006@gnu.org>
     [not found]   ` <E1IovyW-0001nS-4a@etlken.m17n.org>
2007-11-06 19:53     ` Reiner Steib
2007-11-07  0:36       ` Kenichi Handa [this message]
2007-11-20 21:08         ` imap.el: international/utf-7.el vs. gnus/utf7.el 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=E1IpYuE-0001U7-MY@etlken.m17n.org \
    --to=handa@ni.aist.go.jp \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=topia@clovery.jp \
    /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).