[issue44560] Unrecognized charset "eucgb2312_cn" in email header for many MUA

TommyLike Hu report at bugs.python.org
Sun Jul 4 04:32:11 EDT 2021


New submission from TommyLike Hu <tommylikehu at gmail.com>:

Email module is used for email message decode and encode, if the header content is gb2312 encoded for example "中文", by design we would finally have a rfc-2047 encoded header as below:
```
=?eucgb2312_cn?b?1tDOxA==?=
```
the test script is as below:
```
from email import header, charset

h = header.make_header([(str("中文").encode("gb2312"),
                         charset.Charset("gb2312"))])
print(h.encode())
```

My question is why don't we use "gb2312" as the charset in rfc-2047 encoded string, considering the "eucgb2312_cn" is only python awareness.

Thanks

----------
components: email
messages: 396939
nosy: barry, r.david.murray, tommylikehu
priority: normal
severity: normal
status: open
title: Unrecognized charset "eucgb2312_cn" in email header for many MUA
type: behavior
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44560>
_______________________________________


More information about the Python-bugs-list mailing list