emacs-devel
[Top][All Lists]
Advanced

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

utf-7-imap doesn't shift back to US-ASCII


From: Daiki Ueno
Subject: utf-7-imap doesn't shift back to US-ASCII
Date: Thu, 28 Feb 2008 18:03:07 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Hello,

When I tried to access Gmail's outgoing message folder via IMAP with
Gnus, I encountered a problem.  The folder name is localized for
Japanese and encoded in UTF-7 + the RFC2060 modification, but Emacs
doesn't seem to encode correctly in that encoding.

RFC2060 5.1 says:

   "&" is used to shift to modified BASE64 and "-" to shift back to US-
   ASCII.  All names start in US-ASCII, and MUST end in US-ASCII (that
   is, a name that ends with a Unicode 16-bit octet MUST end with a "-
   ").

      For example, here is a mailbox name which mixes English, Japanese,
      and Chinese text: ~peter/mail/&ZeVnLIqe-/&U,BTFw-

(encode-coding-string
 (decode-coding-string "~peter/mail/&ZeVnLIqe-/&U,BTFw-" 'utf-7-imap)
 'utf-7-imap)

=> "~peter/mail/&ZeVnLIqe-/&U,BTFw"

Here is a patch to fix this.

Index: lisp/international/utf-7.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/international/utf-7.el,v
retrieving revision 1.11
diff -w -c -r1.11 utf-7.el
*** lisp/international/utf-7.el 1 Feb 2008 16:01:18 -0000       1.11
--- lisp/international/utf-7.el 28 Feb 2008 08:58:00 -0000
***************
*** 110,116 ****
              ;; consistent with iconv, at least regarding `='.
              (skip-chars-forward "^= \t\n")
              (delete-region (point) (point-max))))
!         (unless (eobp)
            (insert ?-)))))
      nil))
  
--- 110,116 ----
              ;; consistent with iconv, at least regarding `='.
              (skip-chars-forward "^= \t\n")
              (delete-region (point) (point-max))))
!         (if (or imap (not (eobp)))
              (insert ?-)))))
      nil))
  
Regards,
-- 
Daiki Ueno




reply via email to

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