增加对micaps文件encoding方式

utf_8_sig
This commit is contained in:
jtang 2023-08-01 21:17:07 +08:00
parent e430c7fe97
commit 2312811938

@ -43,7 +43,7 @@ def read_micaps_1(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -137,7 +137,7 @@ def read_micaps_2(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -239,7 +239,7 @@ def read_micaps_3(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -348,7 +348,7 @@ def read_micaps_4(fname, limit=None, varname='data', varattrs={'units':''}, scal
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -475,7 +475,7 @@ def read_micaps_5(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -573,7 +573,7 @@ def read_micaps_7(fname):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -663,7 +663,7 @@ def read_micaps_8(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -748,7 +748,7 @@ def read_micaps_11(fname, limit=None, scale_off=None, no_level=False,
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try:
@ -881,7 +881,7 @@ def read_micaps_14(fname):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
txt = None
for encoding in encodings:
txt = None
@ -1496,7 +1496,7 @@ def read_micaps_120(fname, limit=None):
return None
# read contents
encodings = ['utf-8', 'gb18030', 'GBK']
encodings = ['utf-8', 'utf_8_sig', 'gb18030', 'GBK']
for encoding in encodings:
txt = None
try: