emojipy.py 文件源码

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

项目:best-ever-chat 作者: lazymeadow 项目源码 文件源码
def ascii_to_unicode(cls, text):
        def replace_ascii(match):
            ascii = text[match.start():match.end()]
            ascii = ascii.encode('ascii', 'ignore').strip()  # convert escaped HTML entities back to original chars
            if not ascii or ascii not in ascii_replace:
                return ascii
            return cls.convert(ascii_replace[ascii])

        text = xhtml_unescape(text)
        return re.sub(cls.ascii_compiled, replace_ascii, text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号