emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: imap.el: international/utf-7.el vs. gnus/utf7.el (was: 23.0.50; utf7


From: Kenichi Handa
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
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Reiner Steib <address@hidden> 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
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]