mirror of
https://github.com/chatmail/core.git
synced 2026-04-27 18:36:30 +03:00
add test apostrophed-encoding with cp1252 charset (aka ANSI aka Windows-1252)
This commit is contained in:
@@ -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
|
||||
|
||||
23
test-data/message/attach_filename_apostrophed_cp1252.eml
Normal file
23
test-data/message/attach_filename_apostrophed_cp1252.eml
Normal 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==--
|
||||
Reference in New Issue
Block a user