h _c@s ddlZddlZddlmZiZdZdgZejZGdddee Z dd Z d d Z e e ejd kr~d dZe edSdS)N)aliasesz --unknown--Z*c@s eZdZdS)CodecRegistryErrorN)__name__Z __module__Z __qualname__rr+/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)NZasciiF._T) isinstanceZbytesZstrZisalnumZappendZisasciiZjoin)encodingZcharsZpunctZcrrrnormalize_encoding+s    r c 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)Nrrz encodings.r)ZfromlistZleveliiz#module "%s" (%s) failed to registerriiiz'incompatible codecs in module "%s" (%s)i)N)_cacheZget_unknownr _aliasesZreplaceZ __import__ _import_tail ImportError getregentryZAttributeErrorr codecsZ CodecInfoZlenrrZ__file__ZcallableZsplitZ getaliases) r ZentryZ norm_encodingZaliased_encodingZmodnamesZmodnameZmodrZ codecaliasesZaliasrrrsearch_functionGs                    (    rZwin32cCsLz6ddl}d|}||kr2ddl}|jWSWdStyJYdS0)Nrzcp%s)_winapiZGetACPZencodings.mbcsZmbcsrr)r rZansi_code_pageZ encodingsrrr _alias_mbcss  r)rZsysr rr rrrZ LookupErrorZ SystemErrorrr rZregisterZplatformrrrrrZs"  U