From 6159257c9da3664c516a26fad1ee942068fbbdd2 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 1 Oct 2019 22:07:32 +0530 Subject: email: Tolerate invalid charset. * email/email.scm (post-process-content-type): If charset is invalid, assume default UTF-8 as charset. * tests/email.scm ("tolerate invalid charset"): New test. Reported-by: Ricardo Wurmus --- tests/email.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests') diff --git a/tests/email.scm b/tests/email.scm index ca0ebc3..1a0ec34 100644 --- a/tests/email.scm +++ b/tests/email.scm @@ -312,6 +312,16 @@ body" "iso-8859-1")) (address . "foo@bar.org")))) "body")) +(test-equal "tolerate invalid charset" + (parse-email-headers + "Content-Type: text/plain; charset=foo +") + `((content-transfer-encoding . 7bit) + (content-type (type . text) + (subtype . plain) + (charset . "utf-8") + (charset . "foo")))) + (test-equal "parse name-addr email address" (parse-email-address "Foo ") '((name . "Foo") (address . "foo@example.org"))) -- cgit v1.2.3