관리-도구
편집 파일: legacy.cpython-38.pyc
U *�e � @ sj d dl mZmZmZmZ d dlmZ ddlmZ ddl m Z deeeee eee ef f d�dd �Zd S )� )�Any�Dict�Optional�Union)�warn� )� from_bytes)�CHARDET_CORRESPONDENCEF)�byte_str�should_rename_legacy�kwargs�returnc K s� t |�r&tdd�t|�� ��� d�� t| ttf�sFtd� t | ����t| t�rXt| �} t| ��� }|dk rr|j nd}|dk r�|jdkr�|jnd}|dk r�d|j nd}|dk r�|d kr�|jr�|d 7 }|dkr�|tkr�t| }|||d�S ) aJ chardet legacy method Detect the encoding of the given byte string. It should be mostly backward-compatible. Encoding name will match Chardet own writing whenever possible. (Not on encoding name unsupported by it) This function is deprecated and should be used to migrate your project easily, consult the documentation for further information. Not planned for removal. :param byte_str: The byte sequence to examine. :param should_rename_legacy: Should we rename legacy encodings to their more modern equivalents? z(charset-normalizer disregard arguments '�,z' in legacy function detect()z4Expected object of type bytes or bytearray, got: {0}N�Unknown� g �?�utf_8Z_sigF)�encoding�language� confidence)�lenr �join�list�keys� isinstance� bytearray�bytes� TypeError�format�typer �bestr r Zchaos�bomr )r r r �rr r r � r"