h _@s ddlZddlZddlmZiZdZdgZejZGdddee Z dd Z d d Z e e ejd kr~d dZe edSdS)N)aliasesz --unknown--*c@s eZdZdS)CodecRegistryErrorN)__name__ __module__ __qualname__r r +/usr/lib64/python3.10/encodings/__init__.pyr(srcCsp t|trt|d}g}d}|D]B}|s6|dkr`|rH|rH|d|rZ||d}q"d}q"d|S)NasciiF._T) isinstancebytesstrisalnumappendisasciijoin)encodingcharspunctcr r r normalize_encoding+s    rc Cspt|t}|tur|St|}t|p:t|dd}|durN||g}n|g}|D]>}|rXd|vrjqXztd|tdd}WntyYqX0qd}z |j }Wnt yd}Yn0|durdt|<dS|}t |t j s"dt|krdksntd|j|jft|drt|d r|d durPt|d r|d durlt|d rt|dkr|ddurt|drt|d kr|d durt|d std |j|jft|dks|ddur|ddt||jdd d f7}t j |}|t|<z |}Wnt yLY|S0|D]} | tvrR|t| <qR|S)Nr r z encodings.r)fromlistlevelz#module "%s" (%s) failed to registerrz'incompatible codecs in module "%s" (%s))N)_cacheget_unknownr_aliasesreplace __import__ _import_tail ImportError getregentryAttributeErrorrcodecs CodecInfolenrr__file__callablesplit getaliases) rentry norm_encodingaliased_encodingmodnamesmodnamemodr+ codecaliasesaliasr r r search_functionGs                    (    r<win32cCsLz6ddl}d|}||kr2ddl}|jWSWdStyJYdS0)Nrzcp%s)_winapiZGetACPZencodings.mbcsmbcsr+r*)rr>Zansi_code_page encodingsr r r _alias_mbcss  rA)r-sysrrr#r%r)r& LookupError SystemErrorrrr<registerplatformrAr r r r s"  U