* eword-decode.el (eword-decode-string, eword-decode-region)
authoryamaoka <yamaoka>
Tue, 25 Nov 2008 02:59:00 +0000 (02:59 +0000)
committeryamaoka <yamaoka>
Tue, 25 Nov 2008 02:59:00 +0000 (02:59 +0000)
 (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
eword-decode.el
tests/test-rfc2231.el

index 68da2c9..4fe6bd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-11-25  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * 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  <yoichi@geiin.org>
 
        * mel-q-ccl.el (mel-ccl-256-to-16-table): Accept (illegal) lower
index fdf895d..880c53e 100644 (file)
@@ -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
index 62a3b4b..6426d80 100644 (file)
 (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))
    (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)))
 
 ;;;