Barry A. Warsaw <[EMAIL PROTECTED]> added the comment:

This example works though, and it also works in earlier Pythons.


from email.header import Header

def main():
    # coding: utf8
    ADDRESS = '[EMAIL PROTECTED]'
    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()

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4306>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to