[Python] IMAP folder path encoding (IMAP UTF-7) for Python

Discussão em 'Python' iniciado por Stack, Junho 25, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to know if any "official" function/library existed in Python for IMAP4 UTF-7 folder path encoding.

    In the imapInstance.list() I get the following path IMAP UTF-7 encoded :

    '(\\HasNoChildren) "." "[Mails].Test&AOk-"',


    If I do the following encoding :

    (u"[Mails].Testé").encode('utf-7')


    I get :

    '[Mails].Test+AOk-'


    Which is UTF-7 but not IMAP UTF-7 encoded. Test+AOk- instead of Test&AOk- I'd need an official function or library to get the IMAP UTF-7 encoded version.

    Continue reading...

Compartilhe esta Página