grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026a ´i%ã@stdZddlZddd„Zddd„ZGdd „d ejƒZGd d „d ejƒ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 ú+/usr/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) Ú__doc__rr rrr'r&r,r.r5r r r r Ús   $