python3.x - How to use maketrans in python in utf-8 files
I wrote a file to process text, which is to replace all the symbols in the text with spaces. Use maketrans and translate in python. It is normal when using ASCII encoded files, but when using UTF-8 files, an error is reported, prompting that the parameters in maketrans are not of equal length...
过去多啦不再A梦 2017-05-18 10:58:56 0 1 554
python如何对字符串中的字符进行映射?
比如我想将一个字符串中的所有字符变成它ASCII码中前7位的数字,在C里面只要写 {代码...} 在python中应该如何处理呢?用maketrans建立转化表的话一个个输入所有ASCII字符太慢了
怪我咯 2017-04-18 10:16:54 0 1 524