
    Rh                     F    d Z g dZddlmZ ddlmZ d Zd Z	d Z
d Zd	 Zy
)z Encodings and related functions.)encode_7or8bitencode_base64encode_noopencode_quopri    )encodebytes)encodestringc                 @    t        | d      }|j                  dd      S )NT)	quotetabs    s   =20)_encodestringreplace)sencs     %/usr/lib/python3.12/email/encoders.py_qencoder      s    
T
*C;;tV$$    c                 ~    | j                  d      }t        t        |      d      }| j                  |       d| d<   y)zlEncode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    Tdecodeasciibase64Content-Transfer-EncodingN)get_payloadstr_bencodeset_payloadmsgorigencdatas      r   r   r      s;    
 ??$?'D(4.'*GOOG'/C#$r   c                 j    | j                  d      }t        |      }| j                  |       d| d<   y)zvEncode the message's payload in quoted-printable.

    Also, add an appropriate Content-Transfer-Encoding header.
    Tr   zquoted-printabler   N)r   r   r   r   s      r   r   r   $   s4    
 ??$?'DtnGOOG'9C#$r   c                     | j                  d      }|d| d<   y	 |j                  d       d| d<   y# t        $ r d| d<   Y yw xY w)z9Set the Content-Transfer-Encoding header to 7bit or 8bit.Tr   N7bitr   r   8bit)r   r   UnicodeError)r   r   s     r   r   r   /   s_    ??$?'D|+1'(2G ,2'(  2+1'(2s   3 AAc                      y)zDo nothing.N )r   s    r   r   r   @   s    r   N)__doc____all__r   r   r   quoprir   r   r   r   r   r   r   r'   r   r   <module>r+      s2   
 ' + 0%0:2"r   