UTF-8 decode error
UTF-8 decode error
When opening a file with file code cp936, an error will be reported
The file must contain Chinese characters
error UTF-8 decode error
The file must contain Chinese characters
error UTF-8 decode error
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: UTF-8 decode error
attach the file here.
i will see how Cud shows error for it.
i will see how Cud shows error for it.
Re: UTF-8 decode error
thank you!!!
- Attachments
-
- Export_A1_Table.py111.py
- (678 Bytes) Downloaded 35 times
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: UTF-8 decode error
this file has broken UTF8 text in the line 9. see how Sublime Text shows this line 9 when i force UTF8 (menu File / Reopen with encoding):
so Cud error-message is good.
file 1st line:
Code: Select all
from tkinter import ttk #????һ??????
file 1st line:
# -*- coding: utf-8 -*-
Re: UTF-8 decode error
After removing the comment on line 9, the file opened smoothly
The comment section is in Chinese
The comment section is in Chinese
Re: UTF-8 decode error
Delete the first line, the file opens smoothly
file 1st line:
# -*- coding: utf-8 -*-
Cud uses uft-8 encoding to open the file, and the actual encoding of the file is cp936(GBK)
file 1st line:
# -*- coding: utf-8 -*-
Cud uses uft-8 encoding to open the file, and the actual encoding of the file is cp936(GBK)
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: UTF-8 decode error
so file 1st line comment is wrong. it must be removed/changed. Cud works ok.
Re: UTF-8 decode error
Thank you for helping me find the problem!!!
-
- Posts: 2245
- Joined: 25.08.2021 18:15
Re: UTF-8 decode error
i found that Cud has a bug here!! it cannot reload broken utf8 text as cp1252, so it cannot load your file at all. fix made. now Cud auto-reloads your file as cp1252.
Re: UTF-8 decode error
Thank you very much for correcting the program