| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/chardet/__pycache__/ |
Upload File : |
a
2<�a� � @ sD d dl mZ d dlmZ d dlmZmZ g d�Zdd� Zdd� Z d S )
� )�UniversalDetector)�
InputState)�__version__�VERSION)r �detect�
detect_allr r c C sH t | t�s0t | t�s(td�t| ����nt| �} t� }|�| � |�� S )z�
Detect the encoding of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
�3Expected object of type bytes or bytearray, got: {}) �
isinstance� bytearray�bytes� TypeError�format�typer �feed�close)�byte_str�detector� r �4/usr/lib/python3.9/site-packages/chardet/__init__.pyr s
�
r c C s� t | t�s0t | t�s(td�t| ����nt| �} t� }|�| � |�� |j t
jkr�g }|jD ]X}|�
� |jkr^|j}|j�� }|�d�r�|jr�|j�||�}|�||�
� |jd�� q^t|�dkr�t|dd� d�S |jgS )z�
Detect all the possible encodings of the given byte string.
:param byte_str: The byte sequence to examine.
:type byte_str: ``bytes`` or ``bytearray``
r ziso-8859)�encoding�
confidence�language� c S s
| d S )Nr r )�resultr r r �<lambda>Q � zdetect_all.<locals>.<lambda>)�key)r r
r r r
r r r r Z_input_stater Z HIGH_BYTEZ_charset_probersZget_confidenceZMINIMUM_THRESHOLD�charset_name�lower�
startswithZ_has_win_bytesZISO_WIN_MAP�get�appendr �len�sortedr )r r �resultsZproberr Zlower_charset_namer r r r - s8
�
��
r N)
Zuniversaldetectorr Zenumsr �versionr r �__all__r r r r r r �<module> s