From 783f2aac79c89e177e2a3fbdb7dc25a5f83252ef Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 27 Dec 2021 23:32:44 +0800 Subject: [PATCH] =?UTF-8?q?chore.=E6=9B=B4=E6=96=B0Linux=E4=B8=8BPython?= =?UTF-8?q?=E9=9B=86=E6=88=90=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Python/interface.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Python/interface.py b/src/Python/interface.py index 763fdcd482..f6d112b7a7 100644 --- a/src/Python/interface.py +++ b/src/Python/interface.py @@ -216,8 +216,13 @@ if __name__ == "__main__": @Asst.CallBackType def my_callback(msg, details, arg): - d = json.loads(details.decode('gbk')) - print(Message(msg), d, arg) + m = Message(msg) + if platform.system().lower() == 'windows': + d = json.loads(details.decode('gbk')) + else: + d = json.loads(details.decode('utf-8')) + + print(m, d, arg) if platform.system().lower() == 'windows': dirname: str = (pathlib.Path.cwd().parent.parent / 'x64' / 'Release').__str__()