]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-66788: Add the utf-7-imap codec (GH-153149)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 8 Jul 2026 11:55:27 +0000 (14:55 +0300)
committerGitHub <noreply@github.com>
Wed, 8 Jul 2026 11:55:27 +0000 (14:55 +0300)
commit562606deed4e78e0cb9b5b09b158f473a1fd8432
treec376e55f5ecbbf3091130ef88a536f0928ef3c36
parentc11af48fddb1fd5b38e2f026c333e8487f3bcc53
gh-66788: Add the utf-7-imap codec (GH-153149)

Implement the modified UTF-7 encoding used for international IMAP4
mailbox names (RFC 3501, section 5.1.3).  It differs from UTF-7:
"&" is the shift character ("&-" encodes a literal "&"), "," replaces
"/" in the Base64 alphabet, and all non-printable-ASCII characters are
Base64-encoded.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Doc/library/codecs.rst
Doc/whatsnew/3.16.rst
Lib/encodings/aliases.py
Lib/encodings/utf_7_imap.py [new file with mode: 0644]
Lib/test/test_codecs.py
Misc/NEWS.d/next/Library/2026-07-05-22-30-00.gh-issue-66788.tM7pQ2.rst [new file with mode: 0644]