'ascii' codec can't decode byte 0xe8 in position 194: ordinal not in range(128))
时间: 2023-10-30 08:09:00 浏览: 33
This error message usually occurs when trying to decode a string that contains non-ASCII characters using the ASCII codec. The byte 0xe8 represents a non-ASCII character, which cannot be decoded by the ASCII codec.
To fix this error, you can try using a different codec that supports the characters in the string. For example, you can try using the UTF-8 codec:
```
string = b'\xe8'
decoded_string = string.decode('utf-8')
```
Alternatively, you can remove the non-ASCII characters from the string if they are not necessary:
```
string = b'some string with \xe8'
cleaned_string = string.decode('ascii', 'ignore')
```
This will remove the non-ASCII character and decode the rest of the string using the ASCII codec.
相关推荐
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)