o
    f                     @   sP   d Z g dZddlmZ ddlmZ dd Zdd Z	d	d
 Z
dd Zdd ZdS )z Encodings and related functions.)encode_7or8bitencode_base64encode_noopencode_quopri    )encodebytes)encodestringc                 C   s   t | dd}|ddS )NT)	quotetabs    s   =20)_encodestringreplace)senc r   %/usr/lib/python3.10/email/encoders.py_qencode   s   r   c                 C   s0   | j dd}tt|d}| | d| d< dS )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encdatar   r   r   r      s   
r   c                 C   s*   | j dd}t|}| | d| d< dS )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   r   r   r   r   &   s   
r   c                 C   sX   | j dd}|du rd| d< dS z|d W n ty%   d| d< Y dS w d| d< dS )z9Set the Content-Transfer-Encoding header to 7bit or 8bit.Tr   N7bitr   r   8bit)r   r   UnicodeError)r   r   r   r   r   r   2   s   r   c                 C   s   dS )zDo nothing.Nr   )r   r   r   r   r   D   s    r   N)__doc____all__r   r   r   quoprir   r
   r   r   r   r   r   r   r   r   r   <module>   s   