From: yamaoka Date: Tue, 25 Nov 2008 02:58:57 +0000 (+0000) Subject: * eword-decode.el (eword-decode-string, eword-decode-region) X-Git-Tag: flim-1_14-wl-root~7 X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fflim.git;a=commitdiff_plain;h=e7dcab499b32c4dc78996c955f8d18f84e1fc662 * 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. --- diff --git a/ChangeLog b/ChangeLog index 227d38d..e52b052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,19 @@ +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 case representation for decoding. + 2007-11-28 MORIOKA Tomohiko * FLIM: Version 1.14.9 (Goj-Dò) released.-A diff --git a/eword-decode.el b/eword-decode.el index ff38088..3ca4b01 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 @@ -232,7 +236,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 @@ -713,7 +721,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))) ;;;