文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 4b6776ce by wyy

文本编码

parent 85e00be9
......@@ -197,10 +197,13 @@ def getFileContent():
fileStr = open(os.path.join(basedir, UPLOAD_FOLDER, url), 'r', encoding='utf-16').read()
except Exception as e:
try:
fileStr = open(os.path.join(basedir, UPLOAD_FOLDER, url), 'r', encoding='936').read()
except Exception as e:
try:
fileStr = open(os.path.join(basedir, UPLOAD_FOLDER, url), 'r').read()
except Exception as e:
return_dict['return_code'] = '203'
return_dict['return_info'] = '该编码的文本文法打开'
return_dict['return_info'] = '该编码的文本无法打开'
return json.dumps(return_dict, ensure_ascii=False)
# 后端传给前端 return_dict = {'return_code': '200', 'return_info': '处理成功', 'result': fileStr}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment