| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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>
Documentation build overview44 files changed · ± 44 modified ± Modified |
Sorry, something went wrong.
IANA uses UTF-7-IMAP name for this codec. What do you think of using utf-7-imap name? |
Sorry, something went wrong.
There was a problem hiding this comment.
I like Victor's suggestion of using "utf-7-imap" for this codec.
Sorry, something went wrong.
|
Great idea! It doesn't have particular name in RFC 2152, and on Wikipedia it is called mUTF-7, which looks too generic. |
Sorry, something went wrong.
Rename the modified-UTF-7 codec from imap4-utf-7 to utf-7-imap and register the aliases csUTF7IMAP and mUTF-7. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Convert the parametrized utf-7-imap codec tests to the subTests() decorator. Add round-trip cases for "+", "+-" (literal, unlike in UTF-7) and a "," in the Base64 run, and replace the duplicate decode-error cases with a "&" at the end of the input and an unterminated but otherwise valid Base64 sequence. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…7-imap Decode the modified Base64 with binascii.a2b_base64() and the modified alphabet directly, instead of base64.b64decode() with altchars. With strict_mode the "/" character (used by standard Base64 but not by the modified alphabet, which uses ",") is now rejected rather than accepted with a DeprecationWarning. Encoding likewise uses binascii.b2a_base64(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| Back | FazBrowse Home | New Git URL |
Add the utf-7-imap codec, implementing the modified UTF-7 encoding used for international IMAP4 mailbox names (RFC 3501, section 5.1.3).
It differs from UTF-7 (RFC 2152):
The aliases csUTF7IMAP and mUTF-7 are also registered.
This is the codec dependency of gh-49555 (international mailbox names in imaplib). Automatic encoding/decoding of mailbox names in imaplib itself is a separate question, left for later — modern servers accept raw UTF-8 names via UTF8=ACCEPT (RFC 6855), and auto-conversion has non-trivial API implications.
🤖 Generated with Claude Code