Move `base64-token-regexp', `base64-token-padding-regexp',
authormorioka <morioka>
Sat, 19 Sep 1998 18:09:58 +0000 (18:09 +0000)
committermorioka <morioka>
Sat, 19 Sep 1998 18:09:58 +0000 (18:09 +0000)
`eword-B-encoded-text-regexp' and `eword-Q-encoded-text-regexp' to
mime-def.el.
(eword-decode-encoded-text): Use `encoded-text-decode-string'.

eword-decode.el

index 32fd1d4..1f18d48 100644 (file)
          (regexp-quote "?=")))
 
 
-;;; @@ Base64
-;;;
-
-(defconst base64-token-regexp "[A-Za-z0-9+/]")
-(defconst base64-token-padding-regexp "[A-Za-z0-9+/=]")
-
-(defconst eword-B-encoded-text-regexp
-  (concat "\\(\\("
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-regexp
-         "\\)*"
-         base64-token-regexp
-         base64-token-regexp
-         base64-token-padding-regexp
-         base64-token-padding-regexp
-          "\\)"))
-
-;; (defconst eword-B-encoding-and-encoded-text-regexp
-;;   (concat "\\(B\\)\\?" eword-B-encoded-text-regexp))
-
-
-;;; @@ Quoted-Printable
-;;;
-
-(defconst eword-Q-encoded-text-regexp
-  (concat "\\([^=?]\\|" quoted-printable-octet-regexp "\\)+"))
-;; (defconst eword-Q-encoding-and-encoded-text-regexp
-;;   (concat "\\(Q\\)\\?" eword-Q-encoded-text-regexp))
-
-
 ;;; @ for string
 ;;;
 
@@ -317,22 +285,7 @@ if there are in decoded encoded-text (generated by bad manner MUA such
 as a version of Net$cape)."
   (let ((cs (mime-charset-to-coding-system charset)))
     (if cs
-       (let ((dest
-               (cond
-                ((string-equal "B" encoding)
-                 (if (and (string-match eword-B-encoded-text-regexp string)
-                          (string-equal string (match-string 0 string)))
-                     (base64-decode-string string)
-                   (error "Invalid encoded-text %s" string)))
-                ((string-equal "Q" encoding)
-                 (if (and (string-match eword-Q-encoded-text-regexp string)
-                          (string-equal string (match-string 0 string)))
-                     (q-encoding-decode-string string)
-                   (error "Invalid encoded-text %s" string)))
-                (t
-                 (error "Invalid encoding %s" encoding)
-                 )))
-              )
+       (let ((dest (encoded-text-decode-string string encoding)))
          (when dest
            (setq dest (decode-mime-charset-string dest charset))
            (if must-unfold