This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author barry
Recipients barry, vstinner
Date 2008-11-20.16:15:18
SpamBayes Score 0.004072057
Marked as misclassified No
Message-id <1227197719.76.0.357206963859.issue4306@psf.upfronthosting.co.za>
In-reply-to
Content
This example works though, and it also works in earlier Pythons.


from email.header import Header

def main():
    # coding: utf8
    ADDRESS = 'victor.stinner@haypocalc.com'
    from email.mime.text import MIMEText
    msg = MIMEText('accent \xe9\xf4\u0142', 'plain', 'utf-8')
    msg['Subject'] = Header('sujet \xe9\xf4\u0142'.encode('utf-8'),
                            'utf-8')
    msg['From'] = ADDRESS
    msg['To'] = ADDRESS
    text = msg.as_string()
    print("--- FLATTEN ---")
    print(text)
    return

main()
History
Date User Action Args
2008-11-20 16:15:19barrysetrecipients: + barry, vstinner
2008-11-20 16:15:19barrysetmessageid: <1227197719.76.0.357206963859.issue4306@psf.upfronthosting.co.za>
2008-11-20 16:15:19barrylinkissue4306 messages
2008-11-20 16:15:18barrycreate