Your IP : 18.191.120.103


Current Path : /opt/alt/python38/lib64/python3.8/encodings/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/encodings/__pycache__/utf_8_sig.cpython-38.opt-1.pyc

U

i�f%�@stdZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�Zdd�Z	dS)a Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:

* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
  first three bytes.

* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
  bytes will be skipped.
�N�strictcCstjt�||�dt|�fS�Nr)�codecs�BOM_UTF8�utf_8_encode�len)�input�errors�r
�8/opt/alt/python38/lib64/python3.8/encodings/utf_8_sig.py�encodes�rcCsDd}|dd�tjkr&|dd�}d}t�||d�\}}|||fS)Nr�T)rr�utf_8_decode)rr	�prefix�output�consumedr
r
r�decodesrc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N�)rr�__init__�first��selfr	r
r
rrszIncrementalEncoder.__init__FcCs:|jr$d|_tjt�||j�dSt�||j�dSdSr)rrrrr	)rr�finalr
r
rrs�zIncrementalEncoder.encodecCstj�|�d|_dSr)rr�resetr�rr
r
rr'szIncrementalEncoder.resetcCs|jS�N�rrr
r
r�getstate+szIncrementalEncoder.getstatecCs
||_dSrr�r�stater
r
r�setstate.szIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr"r
r
r
rrs


rc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderrrrr
r
rr2szIncrementalDecoder.__init__cCsv|jrht|�dkr*tj�|�r"dSd|_n>d|_|dd�tjkrht�|dd�||�\}}||dfSt�|||�S)Nr
��rr)rrrr�
startswithr)rrr	rrrr
r
r�_buffer_decode6s�z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr'rrrr
r
rrGszIncrementalDecoder.resetcCstj�|�}|d|jfSr)rr'rrr r
r
rrKszIncrementalDecoder.getstatecCstj�||�|d|_dSr)rr'r"rr r
r
rr"PszIncrementalDecoder.setstateN)r)r#r$r%rr+rrr"r
r
r
rr&1s

r&c@seZdZdd�Zddd�ZdS)�StreamWritercCs.tj�|�z|`Wntk
r(YnXdSr)rr,rr�AttributeErrorrr
r
rrVs
zStreamWriter.resetrcCstj|_t||�Sr)rrr)rrr	r
r
rr]szStreamWriter.encodeN)r)r#r$r%rrr
r
r
rr,Usr,c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr.rrr-rr
r
rrbs
zStreamReader.resetrcCspt|�dkrtj�|�r\dSn>|dd�tjkr\tj|_t�|dd�|�\}}||dfStj|_t�||�S)Nr
r()rrrr*rr)rrr	rrr
r
rriszStreamReader.decodeN)r)r#r$r%rrr
r
r
rr.asr.c	Cstjdttttttd�S)Nz	utf-8-sig)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforrrr&r.r,r
r
r
r�getregentryys�r5)r)r)
�__doc__rrrrr'r&r,r.r5r
r
r
r�<module>s	

$

?>