This commit was generated by cvs2svn to compensate for changes in r434,
[elisp/tm.git] / tm-ew-e.el
index ec267f2..1461b65 100644 (file)
@@ -6,7 +6,7 @@
 ;;; Copyright (C) 1993 .. 1996 MORIOKA Tomohiko
 ;;;
 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;;; Version: $Revision: 7.33 $
+;;; Version: $Revision: 7.37 $
 ;;; Keywords: mail, news, MIME, RFC 1522, multilingual, encoded-word
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -36,7 +36,7 @@
 ;;;
 
 (defconst tm-ew-e/RCS-ID
-  "$Id: tm-ew-e.el,v 7.33 1996/06/11 14:34:28 morioka Exp $")
+  "$Id: tm-ew-e.el,v 7.37 1996/07/10 12:52:46 morioka Exp $")
 (defconst mime-eword/encoder-version (get-version-string tm-ew-e/RCS-ID))
 
 
 (defvar mime/use-X-Nsubject nil)
 
 (defvar mime-eword/charset-encoding-alist
-  '(("US-ASCII"       . nil)
-    ("ISO-8859-1"     . "Q")
-    ("ISO-8859-2"     . "Q")
-    ("ISO-8859-3"     . "Q")
-    ("ISO-8859-4"     . "Q")
-;;; ("ISO-8859-5"     . "Q")
-    ("KOI8-R"         . "Q")
-    ("ISO-8859-7"     . "Q")
-    ("ISO-8859-8"     . "Q")
-    ("ISO-8859-9"     . "Q")
-    ("ISO-2022-JP"    . "B")
-    ("ISO-2022-KR"    . "B")
-    ("EUC-KR"         . "B")
-    ("ISO-2022-JP-2"  . "B")
-    ("ISO-2022-INT-1" . "B")
+  '((us-ascii          . nil)
+    (iso-8859-1                . "Q")
+    (iso-8859-2                . "Q")
+    (iso-8859-3                . "Q")
+    (iso-8859-4                . "Q")
+    (iso-8859-5                . "Q")
+    (koi8-r            . "Q")
+    (iso-8859-7                . "Q")
+    (iso-8859-8                . "Q")
+    (iso-8859-9                . "Q")
+    (iso-2022-jp       . "B")
+    (iso-2022-kr       . "B")
+    (euc-kr            . "B")
+    (iso-2022-jp-2     . "B")
+    (iso-2022-int-1    . "B")
     ))
 
-
 ;;; @ encoded-text encoder
 ;;;
 
@@ -78,7 +77,8 @@
               )
         ))
     (if text
-       (concat "=?" charset "?" encoding "?" text "?=")
+       (concat "=?" (upcase (symbol-name charset)) "?"
+               encoding "?" text "?=")
       )))
 
 
 (defmacro tm-eword::rword-type (rword)
   (` (car (cdr (cdr (cdr (, rword)))))))
 
-(defun tm-eword::find-charset-rule (lcl)
-  (if lcl
-      (let* ((charset (mime/find-charset lcl))
-            (encoding
-             (cdr (assoc charset mime-eword/charset-encoding-alist))
-             ))
+(defun tm-eword::find-charset-rule (charsets)
+  (if charsets
+      (let* ((charset (charsets-to-mime-charset charsets))
+            (encoding (cdr (assq charset mime-eword/charset-encoding-alist)))
+            )
        (list charset encoding)
        )))
 
            (setq ac (tm-eword::rword-charset a))
            (if (and (tm-eword::rword-encoding a)
                     (tm-eword::rword-encoding c))
-               (cond ((equal ac cc)
+               (cond ((eq ac cc)
                       (setq prev (cons
                                   (cons (concat (car a)(car b)(car c))
                                         (cdr a))
        (encoding (tm-eword::rword-encoding rword))
        ret)
     (setq ret
-         (cond ((equal encoding "B")
-                (setq string (mime-charset-encode-string string charset))
+         (cond ((string-equal encoding "B")
+                (setq string (encode-mime-charset-string string charset))
                 (base64-encoded-length string)
                 )
-               ((equal encoding "Q")
-                (setq string (mime-charset-encode-string string charset))
+               ((string-equal encoding "Q")
+                (setq string (encode-mime-charset-string string charset))
                 (q-encoding-encoded-length string
                                            (tm-eword::rword-type rword))
                 )))
     (if ret
-       (cons (+ 7 (length charset) ret) string)
+       (cons (+ 7 (length (symbol-name charset)) ret) string)
       )))