[New-bugs-announce] [issue15016] [patch] add special case for latin messages in email.mime.text

Dmitry Shachnev report at bugs.python.org
Wed Jun 6 11:13:28 CEST 2012

New submission from Dmitry Shachnev <Mitya57 at gmail.com>:

(Follow-up to issue 14380)

The attached patch makes the email.mime.text.MIMEText constructor use the iso-8859-1 (aka latin-1) encoding for messages where all characters are in range(256). This also makes them use quoted-printable transfer encoding instead of base64.

So, the current algorithm of guessing encoding is as follows:

- all characters are in range(128) -> encoding is us-ascii
- all characters are in range(256) -> encoding is iso-8859-1 (aka latin-1)
- else                             -> encoding is utf-8

components: email
messages: 162399
nosy: barry, mitya57, r.david.murray
priority: normal
severity: normal
status: open
title: [patch] add special case for latin messages in email.mime.text
type: behavior
versions: Python 3.2, Python 3.3

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list