From 8b7ee6ba5384e589515c0b0ad6a8b306ab5ed662 Mon Sep 17 00:00:00 2001 From: kaoru Date: Sat, 1 Aug 2009 03:22:00 +0000 Subject: [PATCH] * utf7.el (utf7-get-u16char-converter): Revert BOM workaround for Mule-UCS (to-utf-16). (utf7-utf-16-coding-system): Change preference when Mule-UCS on Emacs 23. --- elmo/ChangeLog | 7 +++++++ elmo/utf7.el | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 1749e76..1057b61 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2009-08-01 TAKAHASHI Kaoru + + * utf7.el (utf7-get-u16char-converter): Revert BOM workaround for + Mule-UCS (to-utf-16). + (utf7-utf-16-coding-system): Change preference when Mule-UCS on + Emacs 23. + 2009-07-11 Taiki SUGAWARA * utf7.el (utf7-find-coding-system-without-bom): New Function. diff --git a/elmo/utf7.el b/elmo/utf7.el index 3830272..30fdb74 100644 --- a/elmo/utf7.el +++ b/elmo/utf7.el @@ -102,12 +102,12 @@ (defconst utf7-utf-16-coding-system (or - ;; Mule-UCS - (utf7-find-coding-system-without-bom 'utf-16-be-no-signature) - ;; Emacs 21.3, Emacs 22 + ;; Emacs 22, Emacs 23 + (utf7-find-coding-system-without-bom 'utf-16be) + ;; (utf7-find-coding-system-without-bom 'utf-16-be) - ;; Emacs 21.3, Emacs 22 - (utf7-find-coding-system-without-bom 'utf-16be)) + ;; Mule-UCS + (utf7-find-coding-system-without-bom 'utf-16-be-no-signature)) "Coding system which encodes big endian UTF-16.") (defsubst utf7-imap-get-pad-length (len modulus) @@ -210,7 +210,10 @@ Use IMAP modification if FOR-IMAP is non-nil." (encode-coding-region (point-min)(point-max) utf7-utf-16-coding-system) (set-buffer-multibyte nil) - (goto-char (point-min))) + (goto-char (point-min)) + ;; Remove BOM (Big-endian UTF-16 FE FF) for Mule-UCS + (while (re-search-forward "\376\377" nil t) + (delete-region (match-beginning 0) (match-end 0)))) (lambda () (goto-char (point-min)) (decode-coding-region (point-min) (point-max) -- 1.7.10.4