From 9e4fd3263a84326963af543505f0c5a783eb2f70 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 19 Jul 1998 17:01:08 +0000 Subject: [PATCH] * (TESTPAT): add full automatic testing capability. --- TESTPAT | 851 +++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 505 insertions(+), 346 deletions(-) diff --git a/TESTPAT b/TESTPAT index 5205d2d..37ed743 100644 --- a/TESTPAT +++ b/TESTPAT @@ -13,15 +13,14 @@ ;zero-characters-encoded-word-hack ; violate common sense (very tricky) ;quoted-encoded-word ; violate character sequence semantics -;;; test driver for FLIM-FLAM (and FLIM) +;;; test driver for FLAM (and FLIM) -(defun decode (src dsts &rest opts) +(defun decode-flam (src dsts &rest opts) (setq eword-lexical-analyze-cache nil) (setq eword-decode-sticked-encoded-word (or (memq 'permit-sticked-comment opts) (memq 'permit-sticked-special opts))) (setq eword-decode-quoted-encoded-word nil) - (if (stringp dsts) (setq dsts (list dsts))) (with-temp-buffer (insert src "\n" mail-header-separator) (eword-decode-header 'us-ascii mail-header-separator) @@ -31,11 +30,10 @@ (let ((result (buffer-substring (point-min) (point)))) (if (member result dsts) t result)))) -(defun encode (src dsts &rest opts) +(defun encode-flam (src dsts &rest opts) (setq eword-lexical-analyze-cache nil) (setq eword-decode-sticked-encoded-word nil) (setq eword-decode-quoted-encoded-word nil) - (if (stringp dsts) (setq dsts (list dsts))) (with-temp-buffer (insert src "\n" mail-header-separator) (goto-char (point-min)) @@ -46,9 +44,45 @@ (let ((result (buffer-substring (point-min) (point)))) (if (member result dsts) t result)))) +(setq decode-test 'decode-flam) +(setq encode-test 'encode-flam) + +(setq decode-succ-count 0) +(setq decode-all-count 0) +(defun decode (src dsts &rest opts) + (if (stringp dsts) (setq dsts (list dsts))) + (setq decode-all-count (1+ decode-all-count)) + (let ((res (condition-case nil + (apply decode-test src dsts opts) + (error nil)))) + (if (eq res t) + (setq decode-succ-count (1+ decode-succ-count)) + (insert (format "\n;fail;%S" res))) + res)) + +(setq encode-succ-count 0) +(setq encode-all-count 0) +(defun encode (src dsts &rest opts) + (if (stringp dsts) (setq dsts (list dsts))) + (setq encode-all-count (1+ decode-all-count)) + (let ((res (condition-case nil + (apply encode-test src dsts opts) + (error nil)))) + (if (eq res t) + (setq encode-succ-count (1+ encode-succ-count)) + (insert (format "\n;fail;%S" res))) + res)) + +(defun report () + (insert + (format "\n\"Decode: %d/%d Encode: %d/%d\"" + decode-succ-count decode-all-count + encode-succ-count encode-all-count))) + ;;;start-test;;; -;;; from RFC2047 + +;; Section 1: Decoding examples from RFC2047 (decode "From: =?US-ASCII?Q?Keith_Moore?= " @@ -79,7 +113,7 @@ "From: Nathaniel Borenstein (=?iso-8859-8?b?7eXs+SDv4SDp7Oj08A==?=)" "From: Nathaniel Borenstein (.HNmNeNlNy NoNa NiNlNhNtNp)")*B -; FLIM-FLAM +; FLAM (decode "From: foo@bar.baz (=?ISO-8859-1?Q?a?=)" @@ -139,16 +173,12 @@ "Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)" "Subject: (=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=)") -;;; by akr@jaist.ac.jp +;; Section 2: Decoding trivial inputs. (decode "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= " "From: $B$"(B ") -(encode -"From: $B$"(B " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= ") - (decode "From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= =?ISO-2022-JP?B?GyRCJCQbKEI=?= " @@ -167,55 +197,11 @@ "From: $B$"$$(B ") (decode -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= - " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= ") - -(decode -"From: akr@jaist.ac.jp - (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)" -"From: akr@jaist.ac.jp ($B$"(B\\a$B$$(B)") -; FLIM-FLAM - -(decode -"From: akr@jaist.ac.jp - (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)" -"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)") -; FLIM-FLAM - -(decode -"From: akr@jaist.ac.jp - (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" -"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)") -; FLIM-FLAM - -(decode -"From: akr@jaist.ac.jp - (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" -"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" -'ignore-76bytes-limit) - -(encode -"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" -"From: akr@jaist.ac.jp - (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" -'ignore-76bytes-limit) -; FLIM-FLAM - -(decode "From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?= =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?= =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" "From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)") -(encode -"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" -"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?= - =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?= - =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" -'zero-characters-encoded-word-hack) -; FLIM-FLAM - (decode "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?= " "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") @@ -229,45 +215,6 @@ "From: a=?ISO-2022-JP?B?GyRCJCIbKEI=?=b ") (decode -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= " -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") - -(decode -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) ") - -(decode -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) ") - -(decode -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= " -"From: (a)$B$"(B " -'permit-sticked-comment) - -(decode -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " -"From: $B$"(B(b) " -'permit-sticked-comment) - -(decode -"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " -"From: (a)$B$"(B(b) " -'permit-sticked-comment) - -(decode -"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= " -"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") - -(decode -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" ") - -(decode -"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" " -"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" ") - -(decode "From: \"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\" " "From: \"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\" ") @@ -278,7 +225,7 @@ (decode "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>" "From: < =?ISO-2022-JP?B?GyRCJCIbKEI=?= @jaist.ac.jp>") -; FLIM-FLAM +; FLAM (decode "From: =?ISO-2022-JP?Q?=1B=24BAA=1B=28B?= " @@ -292,41 +239,10 @@ "From: (=?US-ASCII?Q?(?=)foo@bar.baz(=?US-ASCII?Q?))baz@bar.foo(?=)" "From: (=?US-ASCII?Q?(?=)foo@bar.baz(=?US-ASCII?Q?))baz@bar.foo(?=)") -(encode -"From: \"$B$"(B($B$"(B)\" " -"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= ") -; FLIM-FLAM - (decode "From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= " "From: \"$B$"(B($B$"(B)\" ") -(encode -"From: $B$"(B($B$"(B) " -"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= " -'encode-sticked-comment-as-atom) -; FLIM-FLAM - -(encode -"From: $B$"(B($B$"(B) " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=) - " -'permit-sticked-comment) -; FLIM-FLAM - -(encode -"From: $B$"(B($B$"(B) " -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=) - " -'separate-sticked-comment) -; FLIM-FLAM - -(decode -"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=) - " -"From: $B$"(B($B$"(B) " -'permit-sticked-comment) - (decode "From: =?US-ASCII?Q?=28?= , =?US-ASCII?Q?=29?= " "From: \"(\" , \")\" ") @@ -335,152 +251,6 @@ "From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= " "From: \"a\\\"b$B$"(Bc\\\\\" ") -(encode -"From: \"a\\\"b$B$"(Bc\\\\\" " -"From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= ") -; FLIM-FLAM - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=") - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: $B$"(B" -'permit-sticked-special) - -(encode -"To: $B$"(B" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" -'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= " -'separate-sticked-special) - -(decode -"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=") - -(decode -"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: ,$B$"(B" -'permit-sticked-special) - -(encode -"To: ,$B$"(B" -"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: ,$B$"(B" -"To: , =?ISO-2022-JP?B?GyRCJCIbKEI=?= " -'separate-sticked-special) - -(decode -"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=") - -(decode -"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"To: akr@jaist.ac.jp,$B$"(B" -'permit-sticked-special) - -(encode -"To: akr@jaist.ac.jp,$B$"(B" -"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: akr@jaist.ac.jp,$B$"(B" -"To: akr@jaist.ac.jp, =?ISO-2022-JP?B?GyRCJCIbKEI=?= " -'separate-sticked-special) - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;") - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" -"To: $B$"(B:akr@jaist.ac.jp;" -'permit-sticked-special) - -(encode -"To: $B$"(B:akr@jaist.ac.jp;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" -'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B:akr@jaist.ac.jp;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;" -'separate-sticked-special) -; FLIM-FLAM - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;") - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" -"To: $B$"(B:$B$$(B;" -'ignore-76bytes-limit 'permit-sticked-special) - -(encode -"To: $B$"(B:$B$$(B;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" -'ignore-76bytes-limit 'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B:$B$$(B;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?= - =?ISO-2022-JP?B?GyhC?=;" -'zero-characters-encoded-word-hack 'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B:$B$$(B;" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?= - ;" -'separate-sticked-special) -; FLIM-FLAM - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=") - -(decode -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" -"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" -'ignore-76bytes-limit 'permit-sticked-special) - -(encode -"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" -'ignore-76bytes-limit 'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?= - =?ISO-2022-JP?B?GyhC?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?= - =?ISO-2022-JP?B?GyhC?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" -'zero-characters-encoded-word-hack 'permit-sticked-special) -; FLIM-FLAM - -(encode -"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" -"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?= - , =?ISO-2022-JP?B?GyRCJCYbKEI=?= ;, - =?ISO-2022-JP?B?GyRCJCgbKEI=?= " -'separate-sticked-special) -; FLIM-FLAM - (decode "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" "Subject: $B$"(B") @@ -538,52 +308,16 @@ =?ISO-2022-JP?B?GyRCJCQbKEI=?=" "Subject: $B$"(B a $B$$(B") -(encode -"Subject: $B0$(B $BR_(B" -"Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?= - =?US-ASCII?Q?____________________________________________________________?= - =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=") -; FLIM-FLAM - (decode "Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?= =?US-ASCII?Q?____________________________________________________________?= =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=" "Subject: $B0$(B $BR_(B") -(encode -"Subject: $B0$(B $BR_(B" -"Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w==" -'ignore-76bytes-limit 'ignore-75bytes-limit) -; FLIM-FLAM - -(decode -"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=") - -(decode -"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=" -"Subject:$B$"(B" -'permit-sticked-special) - -(encode -"From: .AN! "*B -"From: =?ISO-8859-1?Q?=A1?= ") - (decode "From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= " "From: \"abcdefghijklmnopqrst.AN!()\\\"\\\\\" ")*B -(encode -"From: \"abcdefghijklmnopqrst.AN!()\\\"\\\\\" "*B -"From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= ") -; FLIM-FLAM - -(encode -"From: akr@jaist.ac.jp (abcdefghijklmnopqrst.AN!\\(\\)\"\\\\)"*B -"From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)") -; FLIM-FLAM - (decode "Subject: ?= =?" "Subject: ?= =?") @@ -608,33 +342,14 @@ "Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?=" "Subject: $B$"(B a .HN`")*B -(encode -"Subject: $B$"(B a .HN`"*B -"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?=") - (decode "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=" "Subject: .HN`$BNm(B")*B -(encode -"Subject: .HN`$BNm(B"*B -"Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=") -; FLIM-FLAM - (decode "Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=" "Subject: .HN` $BNm(B")*B -(encode -"Subject: .HN` $BNm(B"*B -'("Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=" - "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?IBskQk5tGyhC?=")) - -(encode -"Subject: .FNC$B4X?t(B"*B -'("Subject: =?ISO-8859-7?Q?=C3?= =?ISO-2022-JP?B?GyRCNFg/dBsoQg==?=" - "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?=")) - (decode "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?=" "Subject: .FNC$B4X?t(B")*B @@ -653,7 +368,433 @@ "Subject: $B$"(B" 'quoted-encoded-word) -;;; quoted-encoded-word $BI=8=(B +(decode +"Subject: = =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: = $B$"(B") + +(decode +"Subject: =? =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =? $B$"(B") + +(decode +"Subject: =?ISO-2022-JP =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP $B$"(B") + +(decode +"Subject: =?ISO-2022-JP? =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP? $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B? =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B? $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI= =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI= $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=? =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=? $B$"(B") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: $B$"$"(B") + +(decode +"Subject: ==?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: ==?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==") + +;; Section 3: Decoding melancholy inputs. + +(decode +"From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= " +"From:=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") +; FLAM + +(decode +"From: akr@jaist.ac.jp + (=?ISO-2022-JP?B?GyRCJCIbKEI=?=\\a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)" +"From: akr@jaist.ac.jp ($B$"(B\\a$B$$(B)") +; FLAM + +(decode +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= " +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") + +(decode +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) ") + +(decode +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) ") + +(decode +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?= " +"From: (a)$B$"(B " +'permit-sticked-comment) + +(decode +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " +"From: $B$"(B(b) " +'permit-sticked-comment) + +(decode +"From: (a)=?ISO-2022-JP?B?GyRCJCIbKEI=?=(b) " +"From: (a)$B$"(B(b) " +'permit-sticked-comment) + +(decode +"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= " +"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?= ") + +(decode +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" ") + +(decode +"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" " +"From: \"a\"=?ISO-2022-JP?B?GyRCJCIbKEI=?=\"b\" ") + +(decode +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=) + " +"From: $B$"(B($B$"(B) " +'permit-sticked-comment) + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: $B$"(B" +'permit-sticked-special) + +(decode +"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: ,$B$"(B" +'permit-sticked-special) + +(decode +"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"To: akr@jaist.ac.jp,$B$"(B" +'permit-sticked-special) + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;") + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" +"To: $B$"(B:akr@jaist.ac.jp;" +'permit-sticked-special) + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;") + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" +"To: $B$"(B:$B$$(B;" +'ignore-76bytes-limit 'permit-sticked-special) + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=") + +(decode +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" +"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" +'ignore-76bytes-limit 'permit-sticked-special) + +(decode +"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject:=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject:$B$"(B" +'permit-sticked-special) + +;; Section 4: Decoding invalid inputs. + +(decode +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= + " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCQbKEI=?= ") + +(decode +"From: akr@jaist.ac.jp + (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)" +"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=a=?ISO-2022-JP?B?GyRCJCQbKEI=?=)") +; FLAM + +(decode +"From: akr@jaist.ac.jp + (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" +"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)") +; FLAM + +(decode +"From: akr@jaist.ac.jp + (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" +"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" +'ignore-76bytes-limit) + +(decode +"Subject: =?=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI==?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI==?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?=?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCIbKEI=?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?==?ISO-2022-JP?B?GyRCJCIbKEI=?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI?=" +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI?=") + +(decode +"Subject: =?ISO-2022-JP?B?GyRCNFg-dBsoQg==?=" +"Subject: =?ISO-2022-JP?B?GyRCNFg-dBsoQg==?=") + +;; Section 5: Encoding trivial inputs. + +(encode +"From: $B$"(B " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= ") + +(encode +"From: \"$B$"(B($B$"(B)\" " +"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= ") +; FLAM + +(encode +"From: \"a\\\"b$B$"(Bc\\\\\" " +"From: =?ISO-2022-JP?B?YSJiGyRCJCIbKEJjXA==?= ") +; FLAM + +(encode +"Subject: $B0$(B $BR_(B" +"Subject: =?ISO-2022-JP?B?GyRCMCQbKEIgICAgICAgICAgICAgICAgICAgICAgICAgICAg?= + =?US-ASCII?Q?____________________________________________________________?= + =?ISO-2022-JP?B?ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIBskQlJfGyhC?=") +; FLAM + +(encode +"Subject: $B0$(B $BR_(B" +"Subject: =?ISO-2022-JP?B?GyQpQrCkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDS3w==" +'ignore-76bytes-limit 'ignore-75bytes-limit) +; FLAM + +(encode +"From: .AN! "*B +"From: =?ISO-8859-1?Q?=A1?= ") + +(encode +"From: \"abcdefghijklmnopqrst.AN!()\\\"\\\\\" "*B +"From: =?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29=22=5C?= ") +; FLAM + +(encode +"From: akr@jaist.ac.jp (abcdefghijklmnopqrst.AN!\\(\\)\"\\\\)"*B +"From: akr@jaist.ac.jp (=?ISO-8859-1?Q?abcdefghijklmnopqrst=A1=28=29\"=5C?=)") +; FLAM + +(encode +"Subject: $B$"(B a .HN`"*B +"Subject: =?ISO-2022-JP?B?GyRCJCIbKEI=?= a =?ISO-8859-8?Q?=E0?=") + +(encode +"Subject: .HN`$BNm(B"*B +"Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=") +; FLAM + +(encode +"Subject: .HN` $BNm(B"*B +'("Subject: =?ISO-8859-8?Q?=E0_?= =?ISO-2022-JP?B?GyRCTm0bKEI=?=" + "Subject: =?ISO-8859-8?Q?=E0?= =?ISO-2022-JP?B?IBskQk5tGyhC?=")) + +(encode +"Subject: .FNC$B4X?t(B"*B +'("Subject: =?ISO-8859-7?Q?=C3?= =?ISO-2022-JP?B?GyRCNFg/dBsoQg==?=" + "Subject: =?ISO-2022-JP-2?B?Gy5GG05DGyRCNFg/dBsoQg==?=")) + +;; Section 6: Encoding melancholy inputs. + +(encode +"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" +"From: akr@jaist.ac.jp + (=?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" +'ignore-76bytes-limit) +; FLAM + +(encode +"From: akr@jaist.ac.jp ($B$"(B($B$$(B)$B$&(B)" +"From: akr@jaist.ac.jp (=?ISO-2022-JP?B?GyRCJCIbKEI=?= + =?ISO-2022-JP?B?GyhC?=(=?ISO-2022-JP?B?GyRCJCQbKEI=?= + =?ISO-2022-JP?B?GyhC?=)=?ISO-2022-JP?B?GyRCJCYbKEI=?=)" +'zero-characters-encoded-word-hack) +; FLAM + +(encode +"From: $B$"(B($B$"(B) " +"From: =?ISO-2022-JP?B?GyRCJCIbKEIoGyRCJCIbKEIp?= " +'encode-sticked-comment-as-atom) +; FLAM + +(encode +"From: $B$"(B($B$"(B) " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?=(=?ISO-2022-JP?B?GyRCJCIbKEI=?=) + " +'permit-sticked-comment) +; FLAM + +(encode +"From: $B$"(B($B$"(B) " +"From: =?ISO-2022-JP?B?GyRCJCIbKEI=?= (=?ISO-2022-JP?B?GyRCJCIbKEI=?=) + " +'separate-sticked-comment) +; FLAM + +(encode +"To: $B$"(B" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=" +'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= " +'separate-sticked-special) + +(encode +"To: ,$B$"(B" +"To: ,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +'permit-sticked-special) +; FLAM + +(encode +"To: ,$B$"(B" +"To: , =?ISO-2022-JP?B?GyRCJCIbKEI=?= " +'separate-sticked-special) + +(encode +"To: akr@jaist.ac.jp,$B$"(B" +"To: akr@jaist.ac.jp,=?ISO-2022-JP?B?GyRCJCIbKEI=?=" +'permit-sticked-special) +; FLAM + +(encode +"To: akr@jaist.ac.jp,$B$"(B" +"To: akr@jaist.ac.jp, =?ISO-2022-JP?B?GyRCJCIbKEI=?= " +'separate-sticked-special) + +(encode +"To: $B$"(B:akr@jaist.ac.jp;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:akr@jaist.ac.jp;" +'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B:akr@jaist.ac.jp;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= :akr@jaist.ac.jp;" +'separate-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=;" +'ignore-76bytes-limit 'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?= + =?ISO-2022-JP?B?GyhC?=;" +'zero-characters-encoded-word-hack 'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B;" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?= + ;" +'separate-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" +'ignore-76bytes-limit 'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?=:=?ISO-2022-JP?B?GyRCJCQbKEI=?= + =?ISO-2022-JP?B?GyhC?=,=?ISO-2022-JP?B?GyRCJCYbKEI=?= + =?ISO-2022-JP?B?GyhC?=;,=?ISO-2022-JP?B?GyRCJCgbKEI=?=" +'zero-characters-encoded-word-hack 'permit-sticked-special) +; FLAM + +(encode +"To: $B$"(B:$B$$(B,$B$&(B;,$B$((B" +"To: =?ISO-2022-JP?B?GyRCJCIbKEI=?= : =?ISO-2022-JP?B?GyRCJCQbKEI=?= + , =?ISO-2022-JP?B?GyRCJCYbKEI=?= ;, + =?ISO-2022-JP?B?GyRCJCgbKEI=?= " +'separate-sticked-special) +; FLAM + +;; Section 7: Using quoted-encoded-words. +; +;; quoted-encoded-word $BI=8=(B ; ; RFC2047 $B$N%G%3!<%@$O@x:_E*$K(B($B%G%3!<%I7k2L$G$J$/(B) encoded-word $B$=$N$b$N$r(B ; $B=PNO$7$J$1$l$P$J$i$J$$$3$H$,$"$k!#(B @@ -673,7 +814,7 @@ ; =?US-ASCII?Q?=3D=3FUS-ASCII=3FQ=3Ftext=3F=3D?= ; ; $B%G%3!<%@$,C1$J$kJ8;zNs$r=PNO$9$k>l9g!"C1=c$K$d$k$H(B encoded-word $B$=$N$b$N$H(B -; encoded-word $B$r6hJL$G$-$J$$!#(B +; encoded-word $B$N$h$&$K$_$($kJ8;zNs$r6hJL$G$-$J$$!#(B ; $B$3$3$G$OJ8;zNsCf$G$=$l$i$r3N