From e69f1b5525b6bb6d8cd08849537dba890c016b93 Mon Sep 17 00:00:00 2001 From: Jordan Wiens Date: Fri, 26 Sep 2025 15:55:40 -0400 Subject: better handling for when utf8 decoding fails --- python/architecture.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/architecture.py') diff --git a/python/architecture.py b/python/architecture.py index 95af9ddd..0b149057 100644 --- a/python/architecture.py +++ b/python/architecture.py @@ -3224,7 +3224,10 @@ class InstructionTextToken: token_type = InstructionTextTokenType(tokens[j].type) text = tokens[j].text if not isinstance(text, str): - text = text.decode("utf-8") + try: + text = text.decode("utf-8") + except UnicodeDecodeError: + text = text.decode("charmap") width = tokens[j].width value = tokens[j].value size = tokens[j].size -- cgit v1.3.1