'Regression test for #14964'

def test_non_ascii_attachment_filename(self):

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