mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
add failing test for apostroped windows-1251 encoding
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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==--
|
||||
Reference in New Issue
Block a user