cyh*_*hao 3 python standards decode utf-8 python-2.7
我用python写:
'\xF5\x90\x90\x90'.decode('utf8')
Run Code Online (Sandbox Code Playgroud)
但它会导致错误:
UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in position 0: invalid start byte
Run Code Online (Sandbox Code Playgroud)
该字符串\xF5\x90\x90\x90是标准的'utf8'字符串.它的二进制是11110101 10010000 10010000 10010000.遵守utf8:11110xxx 10xxxxxx 10xxxxxx 10xxxxxx的规则
为什么我不能解码这个字符串?
| 归档时间: |
|
| 查看次数: |
187 次 |
| 最近记录: |