관리-도구
편집 파일: legacy.cpython-37.opt-1.pyc
B �b8 � @ s� d dl Z d dlmZmZmZ ddlmZmZmZm Z ddl mZ ddlm Z mZ eeeeeeef f d�dd �ZG d d� de �ZG dd � d e�ZG dd� de�ZG dd� de�ZdS )� N)�Dict�Optional�Union� )� from_bytes�from_fp� from_path� normalize)�CHARDET_CORRESPONDENCE)�CharsetMatch�CharsetMatches)�byte_str�returnc C s� t | ttf�s td�t| ����t | t�r2t| �} t| ��� }|dk rL|jnd}|dk rh|j dkrh|j nd}|dk r~d|j nd}|dk r�|dkr�|jr�|d7 }|tkr�|nt| ||d�S ) a� 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. z4Expected object of type bytes or bytearray, got: {0}NZUnknown� g �?�utf_8Z_sig)�encoding�language� confidence) � isinstance� bytearray�bytes� TypeError�format�typer Zbestr r ZchaosZbomr )r �rr r r � r �J/opt/alt/python37/lib/python3.7/site-packages/charset_normalizer/legacy.py�detect s r c @ s e Zd ZdS )�CharsetNormalizerMatchN)�__name__� __module__�__qualname__r r r r r 0 s r c @ s<