HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/mysql/connector/aio/__pycache__/charsets.cpython-39.pyc
a

�,�h�v�@s~dZddgZddlmZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
eGd	d�d��ZGd
d�d�ZdZd
Ze�ZdS)z5This module contains the MySQL Server Character Sets.�Charset�charsets�)�defaultdict)�	dataclass)�DefaultDict�Dict�Optional�Sequence�Tuple�)�ProgrammingErrorc@s2eZdZUdZeed<eed<eed<eed<dS)rz'Dataclass representing a character set.�
charset_id�name�	collation�
is_defaultN)�__name__�
__module__�__qualname__�__doc__�int�__annotations__�str�bool�rr�O/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/connector/aio/charsets.pyr(s

c@speZdZdZdd�dd�Zedd�dd�Zeed	�d
d�Ze	ed�d
d�Z
e	ed�dd�Ze	e	ed�dd�ZdS)�Charsetsa�MySQL supported character sets and collations class.

    This class holds the list of character sets with their collations supported by
    MySQL, making available methods to get character sets by name, collation, or ID.
    It uses a sparse matrix or tree-like representation using a dict in a dict to hold
    the character set name and collations combinations.
    The list is hardcoded, so we avoid a database query when getting the name of the
    used character set or collation.

    The call of ``charsets.set_mysql_major_version()`` should be done before using any
    of the retrieval methods.

    Usage:
        >>> from mysql.connector.aio.charsets import charsets
        >>> charsets.set_mysql_major_version(8)
        >>> charsets.get_by_name("utf-8")
        Charset(charset_id=255,
                name='utf8mb4',
                collation='utf8mb4_0900_ai_ci',
                is_default=True)
    N)�returncCs i|_i|_tt�|_d|_dS)N)�_charset_id_store�_collation_storer�dict�_name_store�_mysql_major_version)�selfrrr�__init__Is
zCharsets.__init__)�versionrcCs�||_|j��|j��|j��d}|dkr6t}n|dkrDt}ntd��|D]<\}}}}t||||�}||j|<||j|<||j||<qPdS)z�Set the MySQL major version.

        Sets what tuple should be used based on the MySQL major version to store the
        list of character sets and collations.

        Args:
            version: The MySQL major version (i.e. 8 or 5)
        N��zInvalid MySQL major version)	r!r�clearrr �MYSQL_8_CHARSETS�MYSQL_5_CHARSETSrr)r"r$Zcharsets_tupler
rrr�charsetrrr�set_mysql_major_versionOs	




z Charsets.set_mysql_major_version)r
rc
CsHz|j|WStyB}ztd|�d��|�WYd}~n
d}~00dS)z�Get character set by ID.

        Args:
            charset_id: The charset ID.

        Returns:
            Charset: The Charset dataclass instance.
        zCharacter set ID � unknownN)r�KeyErrorr)r"r
�errrrr�	get_by_idks	zCharsets.get_by_id)rrc
CsHz|j|WStyB}ztd|�d��|�WYd}~n
d}~00dS)z�Get character set by collation.

        Args:
            collation: The collation name.

        Returns:
            Charset: The Charset dataclass instance.
        z
Collation r,N)rr-r)r"rr.rrr�get_by_collationys	zCharsets.get_by_collation)rrc
Cs�z>|dvr|jdkrd}|j|��D]}|jr&|WSq&Wn6tyt}ztd|�d��|�WYd}~n
d}~00td|�d���dS)	z�Get character set by name.

        Args:
            name: The charset name.

        Returns:
            Charset: The Charset dataclass instance.
        )�utf8zutf-8r%�utf8mb4zCharacter set name r,Nz(No default was found for character set '�')r!r �valuesrr-r)r"rr*r.rrr�get_by_name�s	(zCharsets.get_by_name)rrrc
CsRz|j||WStyL}z$td|�d|�d��|�WYd}~n
d}~00dS)z�Get character set by name and collation.

        Args:
            name: The charset name.
            collation: The collation name.

        Returns:
            Charset: The Charset dataclass instance.
        zCharacter set name 'z' with collation 'z' not foundN)r r-r)r"rrr.rrr�get_by_name_and_collation�s
��z"Charsets.get_by_name_and_collation)
rrrrr#rr+rr/rr0r5r6rrrrr2sr(���big5Zbig5_chinese_ciT�r�latin2Zlatin2_czech_csF���dec8Zdec8_swedish_ciT���cp850Zcp850_general_ciT�r&�latin1Zlatin1_german1_ciF���hp8Zhp8_english_ciT���koi8rZkoi8r_general_ciT�r%rCZlatin1_swedish_ciT��	r;Zlatin2_general_ciT��
�swe7Zswe7_swedish_ciT���asciiZascii_general_ciT���ujisZujis_japanese_ciT��
�sjisZsjis_japanese_ciT���cp1251Zcp1251_bulgarian_ciF��rCZlatin1_danish_ciF���hebrewZhebrew_general_ciT���tis620Ztis620_thai_ciT���euckrZeuckr_korean_ciT���latin7Zlatin7_estonian_csF��r;Zlatin2_hungarian_ciF���koi8uZkoi8u_general_ciT��r[Zcp1251_ukrainian_ciF���gb2312Zgb2312_chinese_ciT���greekZgreek_general_ciT���cp1250Zcp1250_general_ciT��r;Zlatin2_croatian_ciF���gbkZgbk_chinese_ciT���cp1257Zcp1257_lithuanian_ciF���latin5Zlatin5_turkish_ciT��rCZlatin1_german2_ciF�� �armscii8Zarmscii8_general_ciT)�!�utf8mb3Zutf8mb3_general_ciT��"ryZcp1250_czech_csF��#�ucs2Zucs2_general_ciT��$�cp866Zcp866_general_ciT��%�keybcs2Zkeybcs2_general_ciT��&�macceZmacce_general_ciT��'�macromanZmacroman_general_ciT��(�cp852Zcp852_general_ciT��)riZlatin7_general_ciT��*riZlatin7_general_csF��+r�Z	macce_binF��,ryZcp1250_croatian_ciF)�-r2�utf8mb4_general_ciF��.r2Zutf8mb4_binF��/rCZ
latin1_binF��0rCZlatin1_general_ciF��1rCZlatin1_general_csF��2r[Z
cp1251_binF��3r[Zcp1251_general_ciT��4r[Zcp1251_general_csF��5r�Zmacroman_binF��6�utf16Zutf16_general_ciT��7r�Z	utf16_binF��8�utf16leZutf16le_general_ciT��9�cp1256Zcp1256_general_ciT��:r�Z
cp1257_binF��;r�Zcp1257_general_ciT��<�utf32Zutf32_general_ciT��=r�Z	utf32_binF��>r�Zutf16le_binF��?�binaryr�T��@r�Zarmscii8_binF��ArRZ	ascii_binF��BryZ
cp1250_binF��Cr�Z
cp1256_binF��Dr�Z	cp866_binF��Er>Zdec8_binF��FrvZ	greek_binF��Gr`Z
hebrew_binF��HrFZhp8_binF��Ir�Zkeybcs2_binF��JrIZ	koi8r_binF��KrnZ	koi8u_binF)�Lr�Zutf8mb3_tolower_ciF��Mr;Z
latin2_binF��Nr�Z
latin5_binF��OriZ
latin7_binF��PrAZ	cp850_binF��Qr�Z	cp852_binF��RrOZswe7_binF)�Sr�Zutf8mb3_binF��Tr9Zbig5_binF��UrfZ	euckr_binF��VrsZ
gb2312_binF��Wr~Zgbk_binF��XrXZsjis_binF��YrcZ
tis620_binF��Zr�Zucs2_binF��[rUZujis_binF��\�geostd8Zgeostd8_general_ciT��]rZgeostd8_binF��^rCZlatin1_spanish_ciF��_�cp932Zcp932_japanese_ciT��`rZ	cp932_binF��a�eucjpmsZeucjpms_japanese_ciT��brZeucjpms_binF��cryZcp1250_polish_ciF��er�Zutf16_unicode_ciF��fr�Zutf16_icelandic_ciF��gr�Zutf16_latvian_ciF��hr�Zutf16_romanian_ciF��ir�Zutf16_slovenian_ciF��jr�Zutf16_polish_ciF��kr�Zutf16_estonian_ciF��lr�Zutf16_spanish_ciF��mr�Zutf16_swedish_ciF��nr�Zutf16_turkish_ciF��or�Zutf16_czech_ciF��pr�Zutf16_danish_ciF��qr�Zutf16_lithuanian_ciF��rr�Zutf16_slovak_ciF��sr�Zutf16_spanish2_ciF��tr�Zutf16_roman_ciF��ur�Zutf16_persian_ciF��vr�Zutf16_esperanto_ciF��wr�Zutf16_hungarian_ciF��xr�Zutf16_sinhala_ciF��yr�Zutf16_german2_ciF��zr�Zutf16_croatian_ciF��{r�Zutf16_unicode_520_ciF��|r�Zutf16_vietnamese_ciF��r�Zucs2_unicode_ciF��r�Zucs2_icelandic_ciF��r�Zucs2_latvian_ciF��r�Zucs2_romanian_ciF��r�Zucs2_slovenian_ciF��r�Zucs2_polish_ciF��r�Zucs2_estonian_ciF��r�Zucs2_spanish_ciF��r�Zucs2_swedish_ciF��r�Zucs2_turkish_ciF��r�Z
ucs2_czech_ciF��r�Zucs2_danish_ciF��r�Zucs2_lithuanian_ciF��r�Zucs2_slovak_ciF��r�Zucs2_spanish2_ciF��r�Z
ucs2_roman_ciF��r�Zucs2_persian_ciF��r�Zucs2_esperanto_ciF��r�Zucs2_hungarian_ciF��r�Zucs2_sinhala_ciF��r�Zucs2_german2_ciF��r�Zucs2_croatian_ciF��r�Zucs2_unicode_520_ciF��r�Zucs2_vietnamese_ciF��r�Zucs2_general_mysql500_ciF��r�Zutf32_unicode_ciF��r�Zutf32_icelandic_ciF��r�Zutf32_latvian_ciF��r�Zutf32_romanian_ciF��r�Zutf32_slovenian_ciF��r�Zutf32_polish_ciF��r�Zutf32_estonian_ciF��r�Zutf32_spanish_ciF��r�Zutf32_swedish_ciF��r�Zutf32_turkish_ciF��r�Zutf32_czech_ciF��r�Zutf32_danish_ciF��r�Zutf32_lithuanian_ciF��r�Zutf32_slovak_ciF��r�Zutf32_spanish2_ciF��r�Zutf32_roman_ciF��r�Zutf32_persian_ciF��r�Zutf32_esperanto_ciF��r�Zutf32_hungarian_ciF��r�Zutf32_sinhala_ciF��r�Zutf32_german2_ciF��r�Zutf32_croatian_ciF��r�Zutf32_unicode_520_ciF��r�Zutf32_vietnamese_ciF)�r�Zutf8mb3_unicode_ciF)�r�Zutf8mb3_icelandic_ciF)��r�Zutf8mb3_latvian_ciF)��r�Zutf8mb3_romanian_ciF)��r�Zutf8mb3_slovenian_ciF)��r�Zutf8mb3_polish_ciF)��r�Zutf8mb3_estonian_ciF)��r�Zutf8mb3_spanish_ciF)��r�Zutf8mb3_swedish_ciF)��r�Zutf8mb3_turkish_ciF)��r�Zutf8mb3_czech_ciF)��r�Zutf8mb3_danish_ciF)��r�Zutf8mb3_lithuanian_ciF)��r�Zutf8mb3_slovak_ciF)��r�Zutf8mb3_spanish2_ciF)��r�Zutf8mb3_roman_ciF)��r�Zutf8mb3_persian_ciF)��r�Zutf8mb3_esperanto_ciF)��r�Zutf8mb3_hungarian_ciF)��r�Zutf8mb3_sinhala_ciF)��r�Zutf8mb3_german2_ciF)��r�Zutf8mb3_croatian_ciF)��r�Zutf8mb3_unicode_520_ciF)��r�Zutf8mb3_vietnamese_ciF)��r�Zutf8mb3_general_mysql500_ciF���r2Zutf8mb4_unicode_ciF���r2Zutf8mb4_icelandic_ciF���r2Zutf8mb4_latvian_ciF���r2Zutf8mb4_romanian_ciF���r2Zutf8mb4_slovenian_ciF���r2Zutf8mb4_polish_ciF���r2Zutf8mb4_estonian_ciF���r2Zutf8mb4_spanish_ciF���r2Zutf8mb4_swedish_ciF���r2Zutf8mb4_turkish_ciF���r2Zutf8mb4_czech_ciF���r2Zutf8mb4_danish_ciF���r2Zutf8mb4_lithuanian_ciF���r2Zutf8mb4_slovak_ciF���r2Zutf8mb4_spanish2_ciF���r2Zutf8mb4_roman_ciF���r2Zutf8mb4_persian_ciF���r2Zutf8mb4_esperanto_ciF���r2Zutf8mb4_hungarian_ciF���r2Zutf8mb4_sinhala_ciF���r2Zutf8mb4_german2_ciF��r2Zutf8mb4_croatian_ciF��r2Zutf8mb4_unicode_520_ciF��r2Zutf8mb4_vietnamese_ciF���gb18030Zgb18030_chinese_ciT��r�Zgb18030_binF��r�Zgb18030_unicode_520_ciF)�r2Zutf8mb4_0900_ai_ciT)�r2Zutf8mb4_de_pb_0900_ai_ciF)ir2Zutf8mb4_is_0900_ai_ciF)ir2Zutf8mb4_lv_0900_ai_ciF)ir2Zutf8mb4_ro_0900_ai_ciF)ir2Zutf8mb4_sl_0900_ai_ciF)ir2Zutf8mb4_pl_0900_ai_ciF)ir2Zutf8mb4_et_0900_ai_ciF)ir2Zutf8mb4_es_0900_ai_ciF)ir2Zutf8mb4_sv_0900_ai_ciF)i	r2Zutf8mb4_tr_0900_ai_ciF)i
r2Zutf8mb4_cs_0900_ai_ciF)ir2Zutf8mb4_da_0900_ai_ciF)ir2Zutf8mb4_lt_0900_ai_ciF)i
r2Zutf8mb4_sk_0900_ai_ciF)ir2Zutf8mb4_es_trad_0900_ai_ciF)ir2Zutf8mb4_la_0900_ai_ciF)ir2Zutf8mb4_eo_0900_ai_ciF)ir2Zutf8mb4_hu_0900_ai_ciF)ir2Zutf8mb4_hr_0900_ai_ciF)ir2Zutf8mb4_vi_0900_ai_ciF)ir2Zutf8mb4_0900_as_csF)ir2Zutf8mb4_de_pb_0900_as_csF)ir2Zutf8mb4_is_0900_as_csF)ir2Zutf8mb4_lv_0900_as_csF)ir2Zutf8mb4_ro_0900_as_csF)ir2Zutf8mb4_sl_0900_as_csF)ir2Zutf8mb4_pl_0900_as_csF)ir2Zutf8mb4_et_0900_as_csF)ir2Zutf8mb4_es_0900_as_csF)ir2Zutf8mb4_sv_0900_as_csF)i r2Zutf8mb4_tr_0900_as_csF)i!r2Zutf8mb4_cs_0900_as_csF)i"r2Zutf8mb4_da_0900_as_csF)i#r2Zutf8mb4_lt_0900_as_csF)i$r2Zutf8mb4_sk_0900_as_csF)i%r2Zutf8mb4_es_trad_0900_as_csF)i&r2Zutf8mb4_la_0900_as_csF)i(r2Zutf8mb4_eo_0900_as_csF)i)r2Zutf8mb4_hu_0900_as_csF)i*r2Zutf8mb4_hr_0900_as_csF)i,r2Zutf8mb4_vi_0900_as_csF)i/r2Zutf8mb4_ja_0900_as_csF)i0r2Zutf8mb4_ja_0900_as_cs_ksF)i1r2Zutf8mb4_0900_as_ciF)i2r2Zutf8mb4_ru_0900_ai_ciF)i3r2Zutf8mb4_ru_0900_as_csF)i4r2Zutf8mb4_zh_0900_as_csF)i5r2Zutf8mb4_0900_binF)i6r2Zutf8mb4_nb_0900_ai_ciF)i7r2Zutf8mb4_nb_0900_as_csF)i8r2Zutf8mb4_nn_0900_ai_ciF)i9r2Zutf8mb4_nn_0900_as_csF)i:r2Zutf8mb4_sr_latn_0900_ai_ciF)i;r2Zutf8mb4_sr_latn_0900_as_csF)i<r2Zutf8mb4_bs_0900_ai_ciF)i=r2Zutf8mb4_bs_0900_as_csF)i>r2Zutf8mb4_bg_0900_ai_ciF)i?r2Zutf8mb4_bg_0900_as_csF)i@r2Zutf8mb4_gl_0900_ai_ciF)iAr2Zutf8mb4_gl_0900_as_csF)iBr2Zutf8mb4_mn_cyrl_0900_ai_ciF)iCr2Zutf8mb4_mn_cyrl_0900_as_csF)�r7r:r<r?rBrDrGrJrKrMrPrSrVrYr\r^rardrgrjrlrorqrtrwrzr|rr�r�r�)r�r1Zutf8_general_ciTr�r�r�r�r�r�r�r�r�r�r�)r�r2r�Tr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r�r1Zutf8_binFr�r�r�r�rrrrr	rrrrrrrrrr r"r$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rBrDrFrHrJrLrNrPrRrTrVrXrZr\r^r`rbrdrfrhrjrlrnrprrrtrvrxrzr|r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r�r1Zutf8_unicode_ciF)r�r1Zutf8_icelandic_ciF)r�r1Zutf8_latvian_ciF)r�r1Zutf8_romanian_ciF)r�r1Zutf8_slovenian_ciF)r�r1Zutf8_polish_ciF)r�r1Zutf8_estonian_ciF)r�r1Zutf8_spanish_ciF)r�r1Zutf8_swedish_ciF)r�r1Zutf8_turkish_ciF)r�r1Z
utf8_czech_ciF)r�r1Zutf8_danish_ciF)r�r1Zutf8_lithuanian_ciF)r�r1Zutf8_slovak_ciF)r�r1Zutf8_spanish2_ciF)r�r1Z
utf8_roman_ciF)r�r1Zutf8_persian_ciF)r�r1Zutf8_esperanto_ciF)r�r1Zutf8_hungarian_ciF)r�r1Zutf8_sinhala_ciF)r�r1Zutf8_german2_ciF)r�r1Zutf8_croatian_ciF)r�r1Zutf8_unicode_520_ciF)r�r1Zutf8_vietnamese_ciF)r�r1Zutf8_general_mysql500_ciFr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�N)r�__all__�collectionsr�dataclassesr�typingrrrr	r
�errorsrrrr(r)rrrrr�<module>s	z#b