python (3.12.0)
ˑe^ g d Z ddlZddlZddlZddlZddlmZ ddlmZ e j Z
dZdZdZ
dZd Zd
ZdZ e
d Z e
d
Z ej( dej* ej, z Z ej( d Z ej( d Zej4 j6 Zd Z ddZ G d d Z G d d Z G d de Z!y))Header
decode_headermake_header N)HeaderParseError)charset
z N z us-asciizutf-8ai
=\? # literal =?
(?P<charset>[^?]*?) # non-greedy up to the next ? is the charset
\? # literal ?
(?P<encoding>[qQbB]) # either a "q" or a "b", case insensitive
\? # literal ?
(?P<encoded>.*?) # non-greedy up to the next ?= is the encoded string
\?= # literal ?=
z[\041-\176]+:$z
\n[^ \t]+:c
t | d rG| j D cg c]/ \ }}t j |t | t | f1 c}}S t
j
| s| d fgS g }| j D ] }t
j | }d}|s|j d }|r|j }d}|r|j |d d f |rc|j d j }|j d j }|j d } |j | ||f |r g }
t | D ]K \ }}|dkD s|d s||dz
d s||dz
d j s8|
j |dz
M t |
D ] }
||
= g }|D ] \ }}}||j ||f |dk( r3t j"