a XC?h%�@spddlZddd�Zddd�ZGdd�dej�ZGd d �d ej�ZGd d �d ej�ZGd d�dej�Zdd�ZdS)�N�strictcCstjt�||�dt|�fS�Nr)�codecs�BOM_UTF8� utf_8_encode�len)�input�errors�r �8/opt/alt/python39/lib64/python3.9/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 �Zd d �Zd S)�IncrementalEncoderrcCstj�||�d|_dS�N�)rr�__init__�first��selfr r r r rszIncrementalEncoder.__init__FcCs:|jr$d|_tjt�||j�dSt�||j�dSdSr)rrrrr )rr�finalr r r r s �zIncrementalEncoder.encodecCstj�|�d|_dSr)rr�resetr�rr r r r'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 r rs   rc@s6eZdZd dd�Zdd�Zdd�Zdd �Zd d �Zd S)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderrrrr r r r2szIncrementalDecoder.__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 r rGs zIncrementalDecoder.resetcCstj�|�}|d|jfSr)rr'rrr r r r rKs zIncrementalDecoder.getstatecCstj�||�|d|_dSr)rr'r"rr r r r r"PszIncrementalDecoder.setstateN)r)r#r$r%rr+rrr"r r r r r&1s  r&c@seZdZdd�Zddd�ZdS)� StreamWritercCs,tj�|�z|`Wnty&Yn0dSr)rr,rr �AttributeErrorrr r r rVs   zStreamWriter.resetrcCstj|_t||�Sr)rrr )rrr r r r r ]szStreamWriter.encodeN)r)r#r$r%rr r r r r r,Usr,c@seZdZdd�Zddd�ZdS)� StreamReadercCs,tj�|�z|`Wnty&Yn0dSr)rr.rrr-rr r r rbs   zStreamReader.resetrcCspt|�dkrtj�|�r\dSn>|dd�tjkr\tj|_t�|dd�|�\}}||dfStj|_t�||�S)Nr r()rrrr*rr)rrr rrr r r ris   zStreamReader.decodeN)r)r#r$r%rrr r r r r.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) rr rrr'r&r,r.r5r r r r � s  $