From: morioka Date: Sat, 20 Jun 1998 11:33:46 +0000 (+0000) Subject: (quoted-printable-hex-char-to-num): New function. X-Git-Tag: flim-1_5_0~26 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=cbe4472093e0577b98dad70e6b1f214d12e53366;p=elisp%2Fflim.git (quoted-printable-hex-char-to-num): New function. (quoted-printable-decode-string): Use `quoted-printable-hex-char-to-num'. --- diff --git a/mel-q.el b/mel-q.el index 130865e..dc6faee 100644 --- a/mel-q.el +++ b/mel-q.el @@ -158,6 +158,12 @@ It calls external quoted-printable encoder specified by ;;; @ Quoted-Printable decoder ;;; +(defsubst quoted-printable-hex-char-to-num (chr) + (cond ((<= ?a chr) (+ (- chr ?a) 10)) + ((<= ?A chr) (+ (- chr ?A) 10)) + ((<= ?0 chr) (- chr ?0)) + )) + (defun quoted-printable-decode-string (string) "Decode STRING which is encoded in quoted-printable, and return the result." (let (q h l) @@ -166,17 +172,10 @@ It calls external quoted-printable encoder specified by (cond ((eq chr ?=) (setq q t) "") - (q (setq h - (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) + (q (setq h (quoted-printable-hex-char-to-num chr)) (setq q nil) "") - (h (setq l (cond ((<= ?a chr) (+ (- chr ?a) 10)) - ((<= ?A chr) (+ (- chr ?A) 10)) - ((<= ?0 chr) (- chr ?0)) - )) + (h (setq l (quoted-printable-hex-char-to-num chr)) (prog1 (char-to-string (logior (ash h 4) l)) (setq h nil)