Initial commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import chardet
|
||||
|
||||
|
||||
def get_encoding(file):
|
||||
with open(file, 'rb') as f:
|
||||
encoding = chardet.detect(f.read())['encoding']
|
||||
if encoding == 'GB2312':
|
||||
encoding = 'GB18030'
|
||||
return encoding
|
||||
Reference in New Issue
Block a user