_inputstream.py 文件源码

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

项目:habilitacion 作者: GabrielBD 项目源码 文件源码
def lookupEncoding(encoding):
    """Return the python codec name corresponding to an encoding or None if the
    string doesn't correspond to a valid encoding."""
    if isinstance(encoding, binary_type):
        try:
            encoding = encoding.decode("ascii")
        except UnicodeDecodeError:
            return None

    if encoding is not None:
        try:
            return webencodings.lookup(encoding)
        except AttributeError:
            return None
    else:
        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号