sdbmanager.py 文件源码

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

项目:learneveryword 作者: karan 项目源码 文件源码
def encode_string(self, value):
        """Convert ASCII, Latin-1 or UTF-8 to pure Unicode"""
        if not isinstance(value, str):
            return value
        try:
            return six.text_type(value, 'utf-8')
        except:
            # really, this should throw an exception.
            # in the interest of not breaking current
            # systems, however:
            arr = []
            for ch in value:
                arr.append(six.unichr(ord(ch)))
            return u"".join(arr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号