title: IMAP folder path encoding (IMAP UTF-7) for Python
body: <p>I would like to know if any "official" function/library existed in Python for IMAP4 UTF-7 folder path encoding.</p>
  
  <p>In the <code>imapInstance.list()</code> I get the following path IMAP UTF-7 encoded :</p>
  
  <pre><code>'(\\HasNoChildren) "." "[Mails].Test&amp;AOk-"',
  </code></pre>
  
  <p>If I do the following encoding :</p>
  
  <pre><code>(u"[Mails].Testé").encode('utf-7')
  </code></pre>
  
  <p>I get :</p>
  
  <pre><code>'[Mails].Test+AOk-'
  </code></pre>
  
  <p>Which is UTF-7 but not IMAP UTF-7 encoded. <code>Test+AOk-</code> instead of <code>Test&amp;AOk-</code>
  I'd need an official function or library to get the IMAP UTF-7 encoded version.</p>