title: How to get decode this attachment filename with python?
body: <p>I already decoded a lot of email attachments filenames in my code. </p>
  
  <p>But this particular filename breaks my code.</p>
  
  <p>Here is a minimal example:</p>
  
  <pre><code>from email.header import decode_header
  encoded_filename='=?UTF-8?B?U2FsZXNJbnZvaWNl?==?UTF-8?B?LVJlcG9ydC5wZGY=?='
  decoded_header=decode_header(encoded_filename) # --&gt; [('SalesInvoiceQ1|\x04\xb5I\x95\xc1\xbd\xc9\xd0\xb9\xc1\x91\x98', 'utf-8')]
  filename=str(decoded_header[0][0]).decode(decoded_header[0][1])
  </code></pre>
  
  <p>Exception:</p>
  
  <pre><code>UnicodeDecodeError: 'utf8' codec can't decode byte 0xb5 in position 16: invalid start byte
  </code></pre>
  
  <p>Don't ask my how, but Thunderbird is able to decode this filename to: <code>SalesInvoice-Report.pdf</code></p>
  
  <p>How can I decode this with python like email clients apparently are able to?</p>