相关疑难解决方法(0)

如何检查Python中的字符串是否为ASCII?

我想检查一个字符串是否是ASCII格式.

我知道ord(),但是当我尝试时ord('é'),我有TypeError: ord() expected a character, but string of length 2 found.我知道它是由我构建Python的方式引起的(如ord()文档中所述).

还有其他方法可以检查吗?

python string unicode ascii

197
推荐指数
9
解决办法
19万
查看次数

标签 统计

ascii ×1

python ×1

string ×1

unicode ×1