File: //lib64/python3.8/encodings/__pycache__/utf_8_sig.cpython-38.pyc
U
e5d% @ st d Z ddlZdddZdddZG dd d ejZG d
d dejZG dd
d
ejZG dd dejZdd 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.
Nstrictc C s t jt | |d t| fS Nr )codecsBOM_UTF8utf_8_encodelen)inputerrors r
+/usr/lib64/python3.8/encodings/utf_8_sig.pyencode s r c C sD d}| d d t jkr&| dd } d}t | |d\}}||| fS )Nr T)r r utf_8_decode)r r prefixoutputconsumedr
r
r decode s r c @ s8 e Zd ZdddZdddZdd Zd d
Zdd Zd
S )IncrementalEncoderr c C s t j| | d| _d S N )r r __init__firstselfr r
r
r r s zIncrementalEncoder.__init__Fc C s: | j r$d| _ tjt|| jd S t|| jd S d S r )r r r r r )r r finalr
r
r r s zIncrementalEncoder.encodec C s t j| d| _d S r )r r resetr r r
r
r r ' s zIncrementalEncoder.resetc C s | j S Nr r r
r
r getstate+ s zIncrementalEncoder.getstatec C s
|| _ d S r r r stater
r
r setstate. s zIncrementalEncoder.setstateN)r )F)__name__
__module____qualname__r r r r r"