summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenri Sivonen <hsivonen@hsivonen.fi>2018-11-17 20:51:58 +0200
committerKartikaya Gupta (kats) <staktrace@users.noreply.github.com>2019-05-23 21:40:49 -0400
commit9b99524c17455ae741a823d5f90289e7bdc90de8 (patch)
tree60d7bfec0587a3864e8ec2ad7b2316124c5b684b
parent5f051defdafe6f4c43771fdb16765004035b8bf1 (diff)
Test UTF-7 in body
-rw-r--r--src/lib.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 55d0f4f..b5dbfbc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1173,6 +1173,19 @@ mod tests {
assert_eq!(mail.ctype.mimetype, "text/html");
assert_eq!(mail.get_body_raw().unwrap(), b"hello world");
assert_eq!(mail.get_body().unwrap(), "hello world");
+
+ let mail = parse_mail(
+ b"Content-Type: text/plain; charset=UTF-7\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n+JgM-",
+ ).unwrap();
+ assert_eq!(mail.get_body_raw().unwrap(), b"+JgM-");
+ assert_eq!(mail.get_body().unwrap(), "\u{2603}");
+
+ let mail = parse_mail(
+ b"Content-Type: text/plain; charset=UTF-7\r\n\r\n+JgM-",
+ ).unwrap();
+ assert_eq!(mail.get_body_raw().unwrap(), b"+JgM-");
+ assert_eq!(mail.get_body().unwrap(), "\u{2603}");
+
}
#[test]