Hacked By AnonymousFox

Current Path : /opt/alt/python38/lib64/python3.8/email/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/email/__pycache__/charset.cpython-38.opt-2.pyc

U

i�f�B�@srddddgZddlmZddlZddlZddlmZddlmZd	Z	d
Z
dZdZd
Z
dZdZe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfde
e
dfe
e
dfe
ddfe
ddfe
ddfe
e
dfee
dfd�Zddddddddddddddddddddddd d
d!�Zd"d#dd$�Zd+d%d�Zd&d�Zd'd�Zd(d)�ZGd*d�d�ZdS),�Charset�	add_alias�add_charset�	add_codec�)�partialN)�errors)�encode_7or8bit�����us-asciizunknown-8bit�)NNN�iso-2022-jp�utf-8)�
iso-8859-1�
iso-8859-2�
iso-8859-3�
iso-8859-4�
iso-8859-9�iso-8859-10�iso-8859-13�iso-8859-14�iso-8859-15�iso-8859-16zwindows-1252Zvisciir
�big5�gb2312�euc-jp�	shift_jisrzkoi8-rrrrrrrrrrrrzks_c_5601-1987rzeuc-kr)�latin_1zlatin-1Zlatin_2zlatin-2Zlatin_3zlatin-3Zlatin_4zlatin-4Zlatin_5zlatin-5Zlatin_6zlatin-6Zlatin_7zlatin-7Zlatin_8zlatin-8Zlatin_9zlatin-9Zlatin_10zlatin-10�cp949�euc_jp�euc_kr�ascii�eucgb2312_cn�big5_tw)rrr
cCs"|tkrtd��|||ft|<dS)Nz!SHORTEST not allowed for body_enc)�SHORTEST�
ValueError�CHARSETS)�charsetZ
header_encZbody_enc�output_charset�r+�2/opt/alt/python38/lib64/python3.8/email/charset.pyrmscCs|t|<dS�N)�ALIASES)�aliasZ	canonicalr+r+r,r�scCs|t|<dSr-)�	CODEC_MAP)r)Z	codecnamer+r+r,r�scCs"|tkr|�dd�S|�|�SdS)Nr#�surrogateescape)�UNKNOWN8BIT�encode)�string�codecr+r+r,�_encode�sr6c@sXeZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rcCs�z$t|t�r|�d�n
t|d�}Wntk
rBt�|��YnX|��}t�||�|_	t
�|j	ttdf�\}}}|s~|j	}||_
||_t�||�|_t�|j	|j	�|_t�|j|j�|_dS)Nr#)�
isinstance�strr3�UnicodeErrorrZCharsetError�lowerr.�get�
input_charsetr(r&�BASE64�header_encoding�
body_encodingr*r0Zinput_codec�output_codec)�selfr<ZhencZbencZconvr+r+r,�__init__�s,
�
��zCharset.__init__cCs
|j��Sr-)r<r:�rAr+r+r,�__repr__�szCharset.__repr__cCst|�t|���kSr-)r8r:)rA�otherr+r+r,�__eq__�szCharset.__eq__cCs$|jtkrdS|jtkrdStSdS)Nzquoted-printable�base64)r?�QPr=rrCr+r+r,�get_body_encoding�s


zCharset.get_body_encodingcCs|jp
|jSr-)r*r<rCr+r+r,�get_output_charsetszCharset.get_output_charsetcCs6|jpd}t||�}|�|�}|dkr*|S|�||�S)Nr
)r@r6�_get_encoder�
header_encode)rAr4r5�header_bytes�encoder_moduler+r+r,rLs


zCharset.header_encodecCs|jpd}t||�}|�|�}t|j|d�}|��}t|�t}g}	g}
t|�|}|D]�}|
�	|�t
�|
�}
|�t|
|��}||krX|
�
�|	s�|
s�|	�	d�n.|	r�dnd}t
�|
�}t||�}|	�	||��|g}
t|�|}qXt
�|
�}t||�}|	�	||��|	S)Nr
)r)� r)r@r6rKrrLrJ�len�RFC2047_CHROME_LEN�next�append�EMPTYSTRING�join�
header_length�pop)rAr4Z
maxlengthsr5rMrN�encoderr)Zextra�linesZcurrent_line�maxlen�	characterZ	this_lineZlengthZ	separatorZjoined_liner+r+r,�header_encode_lines*s6








zCharset.header_encode_linescCs`|jtkrtjS|jtkr tjS|jtkrXtj�|�}tj�|�}||krPtjStjSndSdSr-)r>r=�email�
base64mimerH�
quoprimimer&rV)rArMZlen64Zlenqpr+r+r,rKhs


zCharset._get_encodercCs�|s|S|jtkr4t|t�r(|�|j�}tj�|�S|jt	krjt|t�rT|�|j�}|�
d�}tj�|�St|t�r�|�|j��
d�}|SdS)N�latin1r#)r?r=r7r8r3r*r]r^�body_encoderH�decoder_)rAr4r+r+r,raws	





zCharset.body_encodeN)
�__name__�
__module__�__qualname__�DEFAULT_CHARSETrBrDrFrIrJrLr\rKrar+r+r+r,r�s,!>)NNN)�__all__�	functoolsrZemail.base64mimer]Zemail.quoprimimerZemail.encodersrrHr=r&rQrfr2rTr(r.r0rrrr6rr+r+r+r,�<module>s��� ��
	


Hacked By AnonymousFox1.0, Coded By AnonymousFox