From 70e5732168698aab8e9ee15f5e0049429aca24a2 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 25 Nov 2008 02:59:00 +0000 Subject: [PATCH] * eword-decode.el (eword-decode-string, eword-decode-region) (eword-analyze-encoded-word): Express the language portion of an encoded word as a symbol. * tests/test-rfc2231.el (test-rfc2231-encoded-word-1) (test-rfc2231-encoded-word-2, test-rfc2231-encoded-word-3): Use eword-decode-string instead of eword-decode-encoded-word. --- ChangeLog | 10 ++++++++++ eword-decode.el | 18 +++++++++++++++--- tests/test-rfc2231.el | 6 +++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68da2c9..4fe6bd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-25 Katsumi Yamaoka + + * eword-decode.el (eword-decode-string, eword-decode-region) + (eword-analyze-encoded-word): Express the language portion of an + encoded word as a symbol. + + * tests/test-rfc2231.el (test-rfc2231-encoded-word-1) + (test-rfc2231-encoded-word-2, test-rfc2231-encoded-word-3): Use + eword-decode-string instead of eword-decode-encoded-word. + 2008-09-20 Yoichi NAKAYAMA * mel-q-ccl.el (mel-ccl-256-to-16-table): Accept (illegal) lower diff --git a/eword-decode.el b/eword-decode.el index fdf895d..880c53e 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -98,7 +98,11 @@ such as a version of Net$cape)." (while match (setq next (match-end 0)) (push (list (match-string 2 string) ;; charset - (match-string 3 string) ;; language + (when (match-beginning 3) ;; language + (intern + (downcase + (substring string + (1+ (match-beginning 3)) (match-end 3))))) (match-string 4 string) ;; encoding (match-string 5 string) ;; encoded-text (match-string 1 string)) ;; encoded-word @@ -239,7 +243,11 @@ such as a version of Net$cape)." (while match (goto-char (setq end (match-end 0))) (push (list (match-string 2) ;; charset - (match-string 3) ;; language + (when (match-beginning 3) ;; language + (intern + (downcase + (buffer-substring (1+ (match-beginning 3)) + (match-end 3))))) (match-string 4) ;; encoding (match-string 5) ;; encoded-text (match-string 1)) ;; encoded-word @@ -720,7 +728,11 @@ be the result.") (while match (setq next (match-end 0)) (push (list (match-string 2 string) ;; charset - (match-string 3 string) ;; language + (when (match-beginning 3) ;; language + (intern + (downcase + (substring string + (1+ (match-beginning 3)) (match-end 3))))) (match-string 4 string) ;; encoding (match-string 5 string) ;; encoded-text (match-string 1 string)) ;; encoded-word diff --git a/tests/test-rfc2231.el b/tests/test-rfc2231.el index 62a3b4b..6426d80 100644 --- a/tests/test-rfc2231.el +++ b/tests/test-rfc2231.el @@ -151,13 +151,13 @@ (luna-define-method test-rfc2231-encoded-word-1 ((case test-rfc2231)) (lunit-assert (string= - (eword-decode-encoded-word "=?US-ASCII?Q?Keith_Moore?=") + (eword-decode-string "=?US-ASCII?Q?Keith_Moore?=") "Keith Moore"))) (luna-define-method test-rfc2231-encoded-word-2 ((case test-rfc2231)) (lunit-assert (string= - (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=") + (eword-decode-string "=?US-ASCII*EN?Q?Keith_Moore?=") "Keith Moore"))) (luna-define-method test-rfc2231-encoded-word-3 ((case test-rfc2231)) @@ -165,7 +165,7 @@ (eq (get-text-property 0 'mime-language - (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=")) + (eword-decode-string "=?US-ASCII*EN?Q?Keith_Moore?=")) 'en))) ;;; -- 1.7.10.4