From 565cbc1ffcc094625a3f44024058454f57744aa0 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 13 Apr 2022 10:45:06 -0400 Subject: Fix issue where utf-8 strings couldn't be used or displayed in the python scripting console --- python/scriptingprovider.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'python/scriptingprovider.py') diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py index 1aab55cb..8dfe3553 100644 --- a/python/scriptingprovider.py +++ b/python/scriptingprovider.py @@ -217,7 +217,7 @@ class ScriptingInstance: def _complete_input(self, ctxt, text, state): try: if not isinstance(text, str): - text = text.decode("charmap") + text = text.decode("utf-8") return ctypes.cast( self.perform_complete_input(text, state).encode("utf-8"), ctypes.c_void_p ).value # type: ignore @@ -681,7 +681,7 @@ from binaryninja import * code = code[:-2] + b'\n' for line in code.split(b'\n'): - self.interpreter.push(line.decode('charmap')) + self.interpreter.push(line.decode("utf-8")) if self.active_view is not None: tryNavigate = True @@ -787,7 +787,7 @@ from binaryninja import * if isinstance(text, str): result = code.compile_command(text) else: - result = code.compile_command(text.decode("charmap")) + result = code.compile_command(text.decode("utf-8")) except: result = False -- cgit v1.3.1