emacs-devel
[Top][All Lists]
Advanced

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

utf-7 encoding in imap.el is applied to already encoded byte sequences


From: Stefan Monnier
Subject: utf-7 encoding in imap.el is applied to already encoded byte sequences
Date: Wed, 12 Dec 2007 14:13:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

It seems that the utf-encode call in imap.el is often (always?) applied
to unibyte data (i.e. streams of bytes, a.k.a already encoded text).

The reason this is so, is because when reading newsrc.eld, Gnus calls
mm-string-as-unibyte (lisp/gnus/gnus-start.el:2420).  It's also because
Gnus pre-encodes the names when they're read from the keyboard in
gnus-read-move-group-name (lisp/gnus/gnus-sum.el:11785).

I see 3 problems here:
1 - The use of mm-string-as-unibyte (I consider any use of
    string-as-unibyte to be wrong, unless it is accompagnied by a comment
    that explains why it is right).
2 - Inconsistent encoding: gnus-sum.el apparently uses utf-8 (at least
    that's what (gnus-group-name-charset to-method to-newsgroup) returned
    in my tests, tho maybe it's because of my locale), whereas
    gnus-start.el uses emacs-mule (implicitly, via mm-string-as-unibyte).
3 - imap.el tries to re-encode in utf7 a folder names that have already
    been encoded (with emacs-mule or utf-8).


        Stefan




reply via email to

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