Re: writing an email.message.Message in UTF-8

2015-12-08 Thread Adam Funk
On 2015-12-07, Terry Reedy wrote: > On 12/7/2015 9:57 AM, Adam Funk wrote: >> I'm trying to write an instance of email.message.Message, whose body >> contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 >> again.) > > The email package was rewritten for, I believe, 3.3. I believe

Re: writing an email.message.Message in UTF-8

2015-12-08 Thread Adam Funk
On 2015-12-08, dieter wrote: > Adam Funk writes: > >> I'm trying to write an instance of email.message.Message, whose body >> contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 >> again.) >> >> reply = email.message.Message() >> reply.set_charset('utf-8') >> ... # s

Re: writing an email.message.Message in UTF-8

2015-12-07 Thread dieter
Adam Funk writes: > I'm trying to write an instance of email.message.Message, whose body > contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 > again.) > > reply = email.message.Message() > reply.set_charset('utf-8') > ... # set various headers > reply.set_paylo

Re: writing an email.message.Message in UTF-8

2015-12-07 Thread Terry Reedy
On 12/7/2015 9:57 AM, Adam Funk wrote: I'm trying to write an instance of email.message.Message, whose body contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 again.) The email package was rewritten for, I believe, 3.3. I believe it should handle unicode email encoded as ut

Re: writing an email.message.Message in UTF-8

2015-12-07 Thread Adam Funk
On 2015-12-07, Adam Funk wrote: > I'm trying to write an instance of email.message.Message, whose body > contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 > again.) > > reply = email.message.Message() > reply.set_charset('utf-8') > ... # set various headers > re

writing an email.message.Message in UTF-8

2015-12-07 Thread Adam Funk
I'm trying to write an instance of email.message.Message, whose body contains unicode characters, to a UTF-8 file. (Python 2.7.3 & 2.7.10 again.) reply = email.message.Message() reply.set_charset('utf-8') ... # set various headers reply.set_payload('\n'.join(body_lines) + '\n')