[New-bugs-announce] [issue4487] Add utf8 alias for email charsets

maxua report at bugs.python.org
Tue Dec 2 14:17:12 CET 2008

New submission from maxua <ischenko at gmail.com>:

When using MIME email package you can specify "utf8" as the encoding. It
will be accepted but it is not rendered correctly in some MUA. E.g. Mac
OS X Mail.app doesn't display it properly while Google Gmail does.

It is confusing since Python itself happily understands both utf8 and utf-8.

The patch adds "utf8" as an alias to "utf-8" encoding which means user
won't need to think twice.

Test case:
from email.MIMEText import MIMEText

msg = MIMEText(u'\u043a\u0438\u0440\u0438\u043b\u0438\u0446\u0430')
print msg.as_string()

components: Library (Lib)
files: charset-utf8-alias.patch
keywords: patch
messages: 76738
nosy: maxua
severity: normal
status: open
title: Add utf8 alias for email charsets
versions: Python 2.5
Added file: http://bugs.python.org/file12191/charset-utf8-alias.patch

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list