zmirror.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:zmirror 作者: aploium 项目源码 文件源码
def encoding_detect(byte_content):
    """
    ??????????????, ????, ??? None
    :param byte_content: ????????
    :type byte_content: bytes
    :return: ?????None
    :rtype: Union[str, None]
    """

    if force_decode_remote_using_encode is not None:
        return force_decode_remote_using_encode
    if possible_charsets:
        for charset in possible_charsets:
            try:
                byte_content.decode(encoding=charset)
            except:
                pass
            else:
                return charset
    if cchardet_available:  # detect the encoding using cchardet (if we have)
        return c_chardet(byte_content)['encoding']

    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号