王锋

王锋的微博

他的个人主页  他的微博

2026年04月25日 星期六 13:42 | 1条评论

评论

我的评论:

发表评论

请 登录 后发表评论。还没有在Zeuux哲思注册吗?现在 注册 !
王锋

回复 王锋  2026年04月25日 星期六 13:57

这个是汉字编码
KeyboardInterrupt
print("\u6c49")

char = "汉"
unicode_code = ord(char)
unicode_code
27721
chr(unicode_code)
'汉'
chr("\u6c49")
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
chr("\u6c49")
TypeError: 'str' object cannot be interpreted as an integer
chr("u6c49")
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
chr("u6c49")
TypeError: 'str' object cannot be interpreted as an integer
chr("6c49")
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
chr("6c49")
TypeError: 'str' object cannot be interpreted as an integer
chr(0x6c49)
'汉'

0条回复

暂时没有评论

Zeuux © 2026

京ICP备05028076号