diff options
author | Henri Sivonen <hsivonen@hsivonen.fi> | 2018-11-17 20:51:58 +0200 |
---|---|---|
committer | Kartikaya Gupta (kats) <staktrace@users.noreply.github.com> | 2019-05-23 21:40:49 -0400 |
commit | 9b99524c17455ae741a823d5f90289e7bdc90de8 (patch) | |
tree | 60d7bfec0587a3864e8ec2ad7b2316124c5b684b | |
parent | 5f051defdafe6f4c43771fdb16765004035b8bf1 (diff) |
Test UTF-7 in body
-rw-r--r-- | src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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] |