bug-gnu-emacs
[Top][All Lists]
Advanced

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

23.0.50; utf7-decode failed with non latin-1 charactor


From: Topia
Subject: 23.0.50; utf7-decode failed with non latin-1 charactor
Date: Fri, 02 Nov 2007 02:45:35 +0900
User-agent: Wanderlust/2.15.5 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/23.0.50 (x86_64-unknown-linux-gnu) MULE/5.0 (SAKAKI)

I want to use imap's internationalized (japanese) folder name,
from Wanderlust. but I see error "Unable to convert from Unicode"
from utf7-u16-latin1-char-converter.

You can see with this code:
   ;; "Sent Mail" in Japanese, imap's UTF-7
   (utf7-decode "&kAFP4W4IMH8w4TD8MOs-" 'imap)

tested on lisp/gnus/utf7.el:
   ;;; arch-tag: 96078b55-85c7-4161-aed2-932c24b282c7


so I found problem that utf7-utf-16-coding-system is nil, because:
 * Emacs 23 has utf-16-be, but this coding system has BOM.
 * utf-16-be-nosig is not found.

I found utf-16-be without BOM version, utf-16be. evalute above code
after (setq utf7-utf-16-coding-system 'utf-16be), no error occured.

Could you modify utf7-utf-16-coding-system to add utf-16be?

 (defconst utf7-utf-16-coding-system
   (cond ((mm-coding-system-p 'utf-16-be-no-signature) ; Mule-UCS
         'utf-16-be-no-signature)
        ((and (mm-coding-system-p 'utf-16-be) ; Emacs 21.3, Emacs 22 (BOM?)
              ;; Avoid versions with BOM.
              (= 2 (length (encode-coding-string "a" 'utf-16-be))))
         'utf-16-be)
+       ((and (mm-coding-system-p 'utf-16be) ; Emacs 22 and later
+             ;; Avoid versions with BOM.
+             (= 2 (length (encode-coding-string "a" 'utf-16be))))
+        'utf-16be)
        ((mm-coding-system-p 'utf-16-be-nosig) ; ?
         'utf-16-be-nosig))
   "Coding system which encodes big endian UTF-16 without a BOM signature.")

In GNU Emacs 23.0.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.12.0)
 of 2007-11-01 on undine
configured using `configure  '--prefix=/usr/opt/emacs/23.0.50' 
'--with-x-toolkit=gtk' '--with-x' '--with-xpm' '--with-jpeg' '--with-tiff' 
'--with-gif' '--with-png' '--with-kerberos5''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: C
  value of $LANG: ja_JP.UTF-8
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Emacs-Lisp

Sorry for bad English.

Regards,
-- 
Topia <topia@clovery.jp>




reply via email to

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