代码风格更新以及加入超电的对接
This commit is contained in:
1 parent
957c535bda
commit
9de485e4ef
117 files changed
+9046
-6457
No files matched your search
@@ -28,8 +28,8 @@ END = '公共参数段结束'
|
||||
|
||||
|
||||
def extract(path):
|
||||
# 文件是 GBK(µVision 习惯),按 gbk 读;失败时退回 gb18030
|
||||
for enc in ('gbk', 'gb18030'):
|
||||
# 优先按 utf-8 读取,兼容历史 gbk / gb18030 编码
|
||||
for enc in ('utf-8', 'gbk', 'gb18030'):
|
||||
try:
|
||||
text = open(path, encoding=enc).read()
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user