When we read a txt file, sometimes there will be an encoding problem, that is, there is an extra zero-width character in a line for no reasonZero-width character , as shown below:
I found that this problem can be solved in python3 as follows:
open(file_path, mode='r', encoding='UTF-8-sig')
Just open the file in this way, provided that the python interpreter is python3