֦i% d Z ddlZddZddZ G d dej Z G d dej Z G d d ej Z G d dej Zd Z y)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. Nc l t j t j | | d z t | fS Nr )codecsBOM_UTF8utf_8_encodelen)inputerrorss ,/usr/lib64/python3.12/encodings/utf_8_sig.pyencoder s1 OOf11%@CCJ c d}| d d t j k( r| dd } d}t j | |d \ }}|||z fS )Nr T)r r utf_8_decode)r r prefixoutputconsumeds r decoder sQ FRayFOO#ab ,,UFDAVXHVO$$r c . e Zd ZddZddZd Zd Zd Zy) IncrementalEncoderc R t j j | | d| _ y N )r r __init__firstselfr s r r zIncrementalEncoder.__init__ s !!**48 r c | j r;d| _ t j t j || j d z S t j || j d S r )r r r r r )r r finals r r zIncrementalEncoder.encode sX ::DJ??&&udkk:1=> > &&udkk:1==r c P t j j | d| _ y r )r r resetr r s r r! zIncrementalEncoder.reset' s !!''- r c | j S Nr r" s r getstatezIncrementalEncoder.getstate+ s zzr c || _ y r$ r% r states r setstatezIncrementalEncoder.setstate. s r Nstrict)F)__name__ __module____qualname__r r r! r&