* eword-decode.el (eword-decode-string, eword-decode-region)
authoryamaoka <yamaoka>
Tue, 25 Nov 2008 02:58:57 +0000 (02:58 +0000)
committeryamaoka <yamaoka>
Tue, 25 Nov 2008 02:58:57 +0000 (02:58 +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 227d38d..e52b052 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,19 @@
+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
        case representation for decoding.
 
+\f
 2007-11-28  MORIOKA Tomohiko  <tomo@kanji.zinbun.kyoto-u.ac.jp>
 
        * FLIM: Version 1.14.9 (Goj\e-Dò) released.\e-A
index ff38088..3ca4b01 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
@@ -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
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)))
 
 ;;;