add test apostrophed-encoding with cp1252 charset (aka ANSI aka Windows-1252)

This commit is contained in:
B. Petersen
2020-12-04 01:28:24 +01:00
parent 8de73c4566
commit e77706f7d0
2 changed files with 32 additions and 0 deletions

View File

@@ -1568,6 +1568,15 @@ mod tests {
assert_eq!(filename, Some("программирование.HTM".to_string()))
}
#[test]
fn test_get_attachment_filename_apostrophed_cp1252() {
let mail = load_mail_with_attachment(include_bytes!(
"../test-data/message/attach_filename_apostrophed_cp1252.eml"
));
let filename = get_attachment_filename(&mail.subparts[1]).unwrap();
assert_eq!(filename, Some("Auftragsbestätigung.pdf".to_string()))
}
#[test]
fn test_get_attachment_filename_combined() {
// test that if `filename` and `filename*0` are given, the filename is not doubled

View File

@@ -0,0 +1,23 @@
Subject: Test apostrophed filenames
Message-ID: 12345@testrun.org
Date: Sat, 07 Dec 2019 19:00:27 +0000
X-Mailer: Kopano 8.7.16
To: recp@testrun.org
From: sender@testrun.org
Content-Type: multipart/mixed; boundary="==BREAK=="
--==BREAK==
Content-Type: text/plain; charset=utf-8
testing cp1252 aka ANSI aka Windows-1252
--==BREAK==
Content-Type: text/html
Content-Disposition: attachment;
filename*=Cp1252''Auftragsbest%E4tigung.pdf;
Content-Transfer-Encoding: base64
PGh0bWw+PGJvZHk+dGV4dDwvYm9keT5kYXRh
--==BREAK==--