What do these '=?utf-8?' sequences mean in python?

Cameron Simpson cs at cskk.id.au
Mon May 8 21:38:55 EDT 2023


On 08May2023 12:19, jak <nospam at please.ty> wrote:
>In reality you should also take into account the fact that if the 
>header
>contains a 'b' instead of a 'q' as a penultimate character, then the
>rest of the package is converted on the basis64
>
>"=?utf-8?Q?"  --> "=?utf-8?B?"

Aye. Specification:

     https://datatracker.ietf.org/doc/html/rfc2047

You should reach for jak's suggested email.header suggestion _before_ 
parsing the subject line. Details:

     https://docs.python.org/3/library/email.header.html#module-email.header

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list