chardet을 사용 하여 파일의 텍스트 내용 인코딩보기
암호:
import chardet
currentFile = open('dev_msra.bmes',mode='rb')
content = currentFile.read()
print(chardet.detect(content))
참고 : Open은 'b'바이너리 열기로 개방 모드를 지정해야하며 'rb'또는 'wb'또는 기타 조합 방법이 필요합니다. 'b'모드 만 사용하는 것만으로는 충분하지 않습니다.