Author ThomasAH
Recipients
Date 2006-07-20.14:22:21
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
from email.Message import Message
from email.Charset import Charset, QP
text = "="
msg = Message()
charset = Charset("utf-8")
charset.header_encoding = QP
charset.body_encoding = QP
msg.set_charset(charset)
msg.set_payload(text)
print msg.as_string()

Gives

MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable

=3D


With the email package from python2.4.3 and 2.4.4c0 the
last '=3D' becomes just '=', so an extra
msg.body_encode(text) is needed.
History
Date User Action Args
2007-08-23 14:41:28adminlinkissue1525919 messages
2007-08-23 14:41:28admincreate