'Regression test for #14964'

def test_non_ascii_attachment_filename(self):

    headers = {'Date': 'Fri,    09    Nov    2001    01:08:47    -0000', 'Message-ID': 'foo'}
    (subject, from_email, to) = ('hello', 'from@example.com', 'to@example.com')
    content = 'This    is    the    message.'
    msg = EmailMessage(subject, content, from_email, [to], headers=headers)
    msg.attach('une    pi\xc3\xa8ce    jointe.pdf', '%PDF-1.4.%...', mimetype='application/pdf')
    msg_bytes = msg.message().as_bytes()
    message = message_from_bytes(msg_bytes)
    payload = message.get_payload()
    self.assertEqual(payload[1].get_filename(), 'une    pi\xc3\xa8ce    jointe.pdf')
