aboutsummaryrefslogtreecommitdiff
path: root/tests/email.scm
diff options
context:
space:
mode:
authorArun Isaac2019-09-17 01:11:44 +0530
committerArun Isaac2019-09-17 01:43:53 +0530
commit203c9c2ae39a4c64bfd9199bbc2deae03c347998 (patch)
treea1c94430104662b5b3354aeb1ee7af6592f4e4b1 /tests/email.scm
parent57d0de6230a95866f7b866cbe4b3481d10dfd1a2 (diff)
downloadguile-email-203c9c2ae39a4c64bfd9199bbc2deae03c347998.tar.gz
guile-email-203c9c2ae39a4c64bfd9199bbc2deae03c347998.tar.lz
guile-email-203c9c2ae39a4c64bfd9199bbc2deae03c347998.zip
email: Tolerate non-ASCII characters in headers.
We tolerate non-ASCII characters in headers in order to support Emacs message mode parens style addresses. * email/email.scm (email->headers+body): Read headers as UTF-8 characters. * tests/email.scm ("tolerate non-ascii characters in headers"): New tests. Reported-by: Christopher Baines <mail@cbaines.net>
Diffstat (limited to 'tests/email.scm')
-rw-r--r--tests/email.scm15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/email.scm b/tests/email.scm
index 530cb8b..8aa9082 100644
--- a/tests/email.scm
+++ b/tests/email.scm
@@ -282,6 +282,21 @@ foo
foo
" "utf-8")))
+(test-equal "tolerate non-ascii characters in headers"
+ (parse-email
+ (string->bytevector
+ "From: foo@bar.org (Foo Bãr)
+
+body" "utf-8"))
+ (make-email
+ `((content-type (type . text)
+ (subtype . plain)
+ (charset . "utf-8"))
+ (content-transfer-encoding . 7bit)
+ (from ((name . "Foo Bãr")
+ (address . "foo@bar.org"))))
+ "body"))
+
(test-equal "parse name-addr email address"
(parse-email-address "Foo <foo@example.org>")
'((name . "Foo") (address . "foo@example.org")))