Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DA-Platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
文档服务地址:
http://47.92.0.57:3000/
周报索引地址:
http://47.92.0.57:3000/s/NruNXRYmV
Open sidebar
Berlin
DA-Platform
Commits
4b6776ce
Commit
4b6776ce
authored
Nov 03, 2020
by
wyy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文本编码
parent
85e00be9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
uploadDownload.py
DAPlatform/views/uploadDownload.py
+4
-1
No files found.
DAPlatform/views/uploadDownload.py
View file @
4b6776ce
...
...
@@ -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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment