From: morioka Date: Sat, 19 Sep 1998 18:09:58 +0000 (+0000) Subject: Move `base64-token-regexp', `base64-token-padding-regexp', X-Git-Tag: chao-1_9-2-199811302358~20 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=900da38dc970d6b1e5110451ce679d35b151705c;p=elisp%2Fflim.git Move `base64-token-regexp', `base64-token-padding-regexp', `eword-B-encoded-text-regexp' and `eword-Q-encoded-text-regexp' to mime-def.el. (eword-decode-encoded-text): Use `encoded-text-decode-string'. --- diff --git a/eword-decode.el b/eword-decode.el index 32fd1d4..1f18d48 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -58,38 +58,6 @@ (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