feat(GODT-3193): preserve attachment encoding.

This commit is contained in:
Jakub
2024-02-29 12:21:29 +01:00
committed by Jakub Cuth
parent 54859a34b2
commit 63e272e270
3 changed files with 37 additions and 0 deletions

View File

@ -837,6 +837,17 @@ func TestPatchNewLineWithHtmlBreaks(t *testing.T) {
}
}
func TestParseCp1250Attachment(t *testing.T) {
r := require.New(t)
f := getFileReader("text_plain_xml_attachment_cp1250.eml")
m, err := Parse(f)
r.NoError(err)
r.Len(m.Attachments, 1)
r.Equal("text/xml; charset=windows-1250; name=\"cp1250.xml\"", m.Attachments[0].Header.Get("Content-Type"))
}
func getFileReader(filename string) io.Reader {
f, err := os.Open(filepath.Join("testdata", filename))
if err != nil {