Current Dir: /snap/core22/2955/usr/lib/python3.10/encodings/__pycache__/
[FILE] aliases.cpython-310.pyc [ edit | delete | rename ]
[FILE] ascii.cpython-310.pyc [ edit | delete | rename ]
[FILE] base64_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] big5.cpython-310.pyc [ edit | delete | rename ]
[FILE] big5hkscs.cpython-310.pyc [ edit | delete | rename ]
[FILE] bz2_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] charmap.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp037.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp273.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp424.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp437.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp500.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp720.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp737.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp775.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp850.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp852.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp855.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp856.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp857.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp858.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp860.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp861.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp862.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp863.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp864.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp865.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp866.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp869.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp874.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp875.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp932.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp949.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp950.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1006.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1026.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1125.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1140.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1250.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1251.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1252.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1253.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1254.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1255.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1256.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1257.cpython-310.pyc [ edit | delete | rename ]
[FILE] cp1258.cpython-310.pyc [ edit | delete | rename ]
[FILE] euc_jisx0213.cpython-310.pyc [ edit | delete | rename ]
[FILE] euc_jis_2004.cpython-310.pyc [ edit | delete | rename ]
[FILE] euc_jp.cpython-310.pyc [ edit | delete | rename ]
[FILE] euc_kr.cpython-310.pyc [ edit | delete | rename ]
[FILE] gb2312.cpython-310.pyc [ edit | delete | rename ]
[FILE] gb18030.cpython-310.pyc [ edit | delete | rename ]
[FILE] gbk.cpython-310.pyc [ edit | delete | rename ]
[FILE] hex_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] hp_roman8.cpython-310.pyc [ edit | delete | rename ]
[FILE] hz.cpython-310.pyc [ edit | delete | rename ]
[FILE] idna.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp_1.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp_2.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp_3.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp_2004.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_jp_ext.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso2022_kr.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_1.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_2.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_3.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_4.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_5.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_6.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_7.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_8.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_9.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_10.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_11.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_13.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_14.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_15.cpython-310.pyc [ edit | delete | rename ]
[FILE] iso8859_16.cpython-310.pyc [ edit | delete | rename ]
[FILE] johab.cpython-310.pyc [ edit | delete | rename ]
[FILE] koi8_r.cpython-310.pyc [ edit | delete | rename ]
[FILE] koi8_t.cpython-310.pyc [ edit | delete | rename ]
[FILE] koi8_u.cpython-310.pyc [ edit | delete | rename ]
[FILE] kz1048.cpython-310.pyc [ edit | delete | rename ]
[FILE] latin_1.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_arabic.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_croatian.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_cyrillic.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_farsi.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_greek.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_iceland.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_latin2.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_roman.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_romanian.cpython-310.pyc [ edit | delete | rename ]
[FILE] mac_turkish.cpython-310.pyc [ edit | delete | rename ]
[FILE] mbcs.cpython-310.pyc [ edit | delete | rename ]
[FILE] oem.cpython-310.pyc [ edit | delete | rename ]
[FILE] palmos.cpython-310.pyc [ edit | delete | rename ]
[FILE] ptcp154.cpython-310.pyc [ edit | delete | rename ]
[FILE] punycode.cpython-310.pyc [ edit | delete | rename ]
[FILE] quopri_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] raw_unicode_escape.cpython-310.pyc [ edit | delete | rename ]
[FILE] rot_13.cpython-310.pyc [ edit | delete | rename ]
[FILE] shift_jis.cpython-310.pyc [ edit | delete | rename ]
[FILE] shift_jisx0213.cpython-310.pyc [ edit | delete | rename ]
[FILE] shift_jis_2004.cpython-310.pyc [ edit | delete | rename ]
[FILE] tis_620.cpython-310.pyc [ edit | delete | rename ]
[FILE] undefined.cpython-310.pyc [ edit | delete | rename ]
[FILE] unicode_escape.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_7.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_8.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_8_sig.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_16.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_16_be.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_16_le.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_32.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_32_be.cpython-310.pyc [ edit | delete | rename ]
[FILE] utf_32_le.cpython-310.pyc [ edit | delete | rename ]
[FILE] uu_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] zlib_codec.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]
Viewing: /snap/core22/2955/usr/lib/python3.10/encodings/__pycache__/__init__.cpython-310.pyc
o
�9j� � @ s� d Z ddlZddlZddlmZ i ZdZdgZejZG dd� de e
�Zd d
� Zdd� Z
e�e
� ejd
kr@dd� Ze�e� dS dS )a2 Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Each codec module must export the following interface:
* getregentry() -> codecs.CodecInfo object
The getregentry() API must return a CodecInfo object with encoder, decoder,
incrementalencoder, incrementaldecoder, streamwriter and streamreader
attributes which adhere to the Python Codec Interface Standard.
In addition, a module may optionally also define the following
APIs which are then used by the package's codec search function:
* getaliases() -> sequence of encoding name strings to use as aliases
Alias names returned by getaliases() must be normalized encoding
names as defined by normalize_encoding().
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
� N� )�aliasesz--unknown--�*c @ s e Zd ZdS )�CodecRegistryErrorN)�__name__�
__module__�__qualname__� r r �)/usr/lib/python3.10/encodings/__init__.pyr ( s r c C sn t | t�r
t| d�} g }d}| D ]!}|�� s|dkr/|r#|r#|�d� |�� r,|�|� d}qd}qd�|�S )ae Normalize an encoding name.
Normalization works as follows: all non-alphanumeric
characters except the dot used for Python package names are
collapsed and replaced with a single underscore, e.g. ' -;#'
becomes '_'. Leading and trailing underscores are removed.
Note that encoding names should be ASCII only.
�asciiF�.�_T� )�
isinstance�bytes�str�isalnum�append�isascii�join)�encoding�chars�punct�cr r r
�normalize_encoding+ s
r c
C sP t �| t�}|tur|S t| �}t�|�pt�|�dd��}|d ur'||g}n|g}|D ]}|r4d|v r5q,ztd| tdd�}W n tyI Y q,w nd }z|j }W n t
y^ d }Y nw |d u rid t | <