Use chardet to view the encoding of the text content of the file
Code:
import chardet
currentFile = open('dev_msra.bmes',mode='rb')
content = currentFile.read()
print(chardet.detect(content))
Note: Open needs to specify the open mode as'b' binary open, and it needs'rb' or'wb' or other combination methods, only using the'b' mode is not enough