汉字转变为ASCII

"""
author:张鑫
date:2021/5/31 15:11
"""


def c_a(name):
name = name.encode('unicode_escape').decode('ascii')
print(name)


if __name__ == '__main__':
name = '返回'
c_a(name)
posted @ 2021-10-20 16:46  布都御魂  阅读(115)  评论(0编辑  收藏  举报