From 3303844ca0b71fcfdce847063fb91233aa8356ea Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Thu, 17 Mar 2022 10:06:09 +0000 Subject: [PATCH] fix encode issue --- libwgopparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwgopparser.py b/libwgopparser.py index 44260b0..d08a511 100644 --- a/libwgopparser.py +++ b/libwgopparser.py @@ -524,7 +524,7 @@ class Parser: } } - troj_config = base64.b64encode(json.dumps(troj_config, ensure_ascii=False)).decode() + troj_config = base64.b64encode(json.dumps(troj_config, ensure_ascii=False).encode()).decode() self.result_postup.append('echo {} | base64 -d > /tmp/temp-trojan-{}-{}.conf'.format(troj_config, self.wg_name, tunnel_name)) self.result_postup.append('''tmux new-window -t tunnel-{} -d '{} -config /tmp/temp-trojan-{}-{}.conf' '''.format( self.wg_name, self.path_bin_trojan, self.wg_name, tunnel_name,