add failing test for apostroped windows-1251 encoding

This commit is contained in:
B. Petersen
2020-12-04 00:19:19 +01:00
parent b510d74c4a
commit 56e6c2712b
2 changed files with 38 additions and 0 deletions

View File

@@ -1545,6 +1545,15 @@ mod tests {
assert_eq!(filename, Some("Maßnahmen März 2022.html".to_string()))
}
#[test]
fn test_get_attachment_filename_apostrophed_windows1251() {
let mail = load_mail_with_attachment(include_bytes!(
"../test-data/message/attach_filename_apostrophed_windows1251.eml"
));
let filename = get_attachment_filename(&mail.subparts[1]).unwrap();
assert_eq!(filename, Some("программирование.HTM".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,29 @@
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
apostrophed filenames as of
https://tools.ietf.org/html/rfc2231,
testing non-utf-8 charset
examples:
%EF%F0%EE%E3%F0%E0%EC%EC%E8%F0%EE%E2%E0%ED%E8%E5 = программирование = programming
--==BREAK==
Content-Type: text/html
Content-Disposition: attachment;
filename*0*=windows-1251''%EF%F0%EE%E3%F0%E0%EC%EC%E8%F0%EE%E2%E0;
filename*1*=%ED%E8%E5.HTM
Content-Transfer-Encoding: base64
PGh0bWw+PGJvZHk+dGV4dDwvYm9keT5kYXRh
--==BREAK==--