使用python
ord('a')
给出
97
但是
ord('é')
给出错误
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: ord() expected a character, but string of length 2 found
如何获取除https://en.wikipedia.org/wiki/List_of_Unicode_characters#Latin-1_Supplement之外的ASCII(é= 233)以外的其他字母的小数?
答案 0 :(得分:2)
您可以先解码它:
ord('é'.decode('utf-8')) # outputs 233