summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2019-10-01 22:07:32 +0530
committerArun Isaac2019-10-01 22:07:32 +0530
commit6159257c9da3664c516a26fad1ee942068fbbdd2 (patch)
tree3504d2a434d0e8989bae9084063df1d0c89d63ce /tests
parent9d82904011516530b6ef1bcd53cef220db485e7a (diff)
downloadguile-email-6159257c9da3664c516a26fad1ee942068fbbdd2.tar.gz
guile-email-6159257c9da3664c516a26fad1ee942068fbbdd2.tar.lz
guile-email-6159257c9da3664c516a26fad1ee942068fbbdd2.zip
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 <rekado@elephly.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/email.scm10
1 files changed, 10 insertions, 0 deletions
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 <foo@example.org>")
'((name . "Foo") (address . "foo@example.org")))