python (3.12.0)
ˑe^ d Z g dZddlZddlZddlZddlZddlmZ ddlm Z
e
j ZdZdZ
dZd Zd
ZdZdZ ed
Z ed Z ej* dej, ej. z Z ej* d Z ej* d Zej6 j8 Zd Z ddZ G d d Z G d d Z G d de! Z"y)z+Header encoding and decoding functionality.)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| dfgS g }| j D ] }t
j | }d}|s|j d }|r|j }d}|r|j |ddf |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"