summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]