def makeAscii(data):
log(repr(data), 5)
#if sys.hexversion >= 0x02050000:
# return data
try:
return data.encode('ascii', "ignore")
except:
log("Hit except on : " + repr(data))
s = u""
for i in data:
try:
i.encode("ascii", "ignore")
except:
log("Can't convert character", 4)
continue
else:
s += i
log(repr(s), 5)
return s
# This function handles stupid utf handling in python.
评论列表
文章目录