[Zope3-checkins] Re: SVN: Zope3/trunk/src/zwiki/ WkikMailer now sends mail encoded in UTF-8

Philipp von Weitershausen philipp at weitershausen.de
Thu Nov 10 11:45:22 EST 2005


Dmitry Vasiliev wrote:
> Log message for revision 40000:
>   WkikMailer now sends mail encoded in UTF-8
>   
> 
> Changed:
>   U   Zope3/trunk/src/zwiki/tests/test_wikimail.py
>   U   Zope3/trunk/src/zwiki/wikipage.py

[snip]

> +    def _getMessage(self, subject, body):
> +        message = MIMEText(body.encode("utf-8"), "plain", self.encoding)
> +        message["Subject"] = Header(subject.encode("utf-8"), self.encoding)

Is there a particular reason why you use the hard-wired 'utf-8' name in
the encode() statement but later use self.encoding in the same lines?
Shouldn't it read:

    def _getMessage(self, subject, body):
        message = MIMEText(body.encode(self.encoding), "plain",
                           self.encoding)
        message["Subject"] = Header(subject.encode(self.encoding),
                                    self.encoding)

Philipp


More information about the Zope3-Checkins mailing list