✏️ 编辑:__init__.cpython-39.opt-1.pyc
路径:
/usr/lib/python3.9/site-packages/chardet/__pycache__/__init__.cpython-39.opt-1.pyc
大小:1.81 KB · 修改:2022-03-25 13:26:00 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a ��=b� � @ 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
💾 保存
取消
保存为 UTF-8,换行统一为 LF