Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
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
Open sidebar
ops
jumpserver
Commits
9b3a5146
Commit
9b3a5146
authored
Mar 15, 2016
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
install_chardet
parent
d48020a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
run_server.py
run_server.py
+4
-1
No files found.
run_server.py
View file @
9b3a5146
...
...
@@ -10,7 +10,7 @@ import os.path
import
threading
import
re
import
functools
import
chardet
from
django.core.signals
import
request_started
,
request_finished
import
tornado.ioloop
...
...
@@ -412,6 +412,9 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
if
self
.
term
.
vim_flag
:
self
.
term
.
vim_data
+=
recv
try
:
print
chardet
.
detect
(
data
)
if
chardet
.
detect
(
data
)
.
encoding
==
'GB2312'
:
data
=
data
.
encode
(
'gbk'
)
.
decode
(
'utf8'
)
self
.
write_message
(
data
)
now_timestamp
=
time
.
time
()
self
.
log_time_f
.
write
(
'
%
s
%
s
\n
'
%
(
round
(
now_timestamp
-
pre_timestamp
,
4
),
len
(
data
)))
...
...
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