all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Topia <topia@clovery.jp>
To: bug-gnu-emacs@gnu.org
Subject: 23.0.50; utf7-decode failed with non latin-1 charactor
Date: Fri, 02 Nov 2007 02:45:35 +0900	[thread overview]
Message-ID: <87ir4lhnb4.wl%topia@clovery.jp> (raw)

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	other threads:[~2007-11-01 17:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 17:45 Topia [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-11-01 17:29 23.0.50; utf7-decode failed with non latin-1 charactor Topia
2007-11-02 12:40 ` Jason Rumney
2007-11-03  3:58   ` Richard Stallman
2007-11-05  7:02   ` Kenichi Handa
2007-11-07 12:12     ` Jason Rumney
2007-11-07 12:51       ` Kenichi Handa

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=87ir4lhnb4.wl%topia@clovery.jp \
    --to=topia@clovery.jp \
    --cc=bug-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.