[Python-Dev] mUTF-7 support?

R. David Murray rdmurray at bitdance.com
Fri Oct 10 04:41:52 CEST 2014


On Fri, 10 Oct 2014 04:28:21 +0200, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Thu, 9 Oct 2014 19:12:29 -0700
> Dan Stromberg <drsalists at gmail.com> wrote:
> > On Thu, Oct 9, 2014 at 3:47 PM, Jesus Cea <jcea at jcea.es> wrote:
> > > I miss mUTF-7 support (as used to encode IMAP4 mailbox names) in Python,
> > > in the codecs module. As an european with a language with 27 different
> > > letters (instead of english 26), tildes, opening question marks, etc., I
> > > find it very inconvenient.
> > >
> > > This encoding is used basically only in IMAP4, I know. But IMAP4 is an
> > > important protocol and all projects related to it needs mUTF-7 support
> > > if they care about non-english alphabets. Everybody has already an
> > > implementation, waste of effort.
> > 
> > I've been parsing up a huge gmail account with no encoding errors,
> > using CPython 2.x and CPython 3.x.  I'd be surprised if there are no
> > foreign characters in any of the thousands of messages there - but
> > maybe I'm just being very lucky.  I'm not specifying a codec, and I
> > don't see a way of specifying one offhand.
> 
> AFAIU, this is specifically about mailbox names, not messages.

Specifically, it is about what we might better term mailbox
*folders*...that is, not what you would normally think of as the
'mailbox name', which is usually understood to be the thing before the @
in the email address (and can't contain non-ASCII yet...we need RFC 6855
support for that, and I'm not sure *anybody* has that yet).

In this context it is the names you give to folders on the IMAP
server...starting (usually) with INBOX and adding from there.  These
names are used in IMAP commands (ex: the 'select' or 'create' commands),
and IMAP uses mUTF-7 for those.

--David


More information about the Python-Dev mailing list