【发布时间】:2020-01-21 11:01:10
【问题描述】:
我读到 endash 不是 ASCII 但是,下面的代码显示:
print(ord('-'))
>>>45
那么,到底是不是ASCII?
其次,当我再次在 Ascii 中查找“endash”时,“-”ASCII 码显示为 8211。
for c in "wireless enhancements – extra costs":
print(c , ord(c))
– 8211
我无法理解这种结束语。请解释
【问题讨论】:
-
嗯,第一个是减号,第二个是破折号。破折号稍宽,不构成 ascii 的一部分。
-
大概第一个是连字符或减号
-(ASCII),而第二个是endash(Unicode) -
谢谢。约翰C,杰米道奇
标签: python python-3.x string ascii unicode-string