Commit 3ccf7ada authored by liuzheng712's avatar liuzheng712

终于修复了乱码啦啦啦

parent 8adf1c5d
......@@ -413,9 +413,9 @@ class WebTerminalHandler(tornado.websocket.WebSocketHandler):
self.term.vim_data += recv
try:
# print chardet.detect(data)
if chardet.detect(data)['encoding'] == 'GB2312':
data = data.decode('gb2312').encode('utf8')
self.write_message(data)
# if chardet.detect(data)['encoding'] == 'GB2312':
# data = data.decode('gb2312').encode('utf8')
self.write_message(data.decode('utf-8', 'replace'))
now_timestamp = time.time()
self.log_time_f.write('%s %s\n' % (round(now_timestamp-pre_timestamp, 4), len(data)))
self.log_file_f.write(data)
......
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