diff options
| author | Jordan Wiens <github@psifertex.com> | 2025-09-26 15:55:40 -0400 |
|---|---|---|
| committer | Jordan <github@psifertex.com> | 2025-10-01 15:19:28 -0400 |
| commit | e69f1b5525b6bb6d8cd08849537dba890c016b93 (patch) | |
| tree | ae7aa18206820c4199f5a948f43f42b0a396071c /python/architecture.py | |
| parent | 420d622f83ad687d5848211f52e2e21693a44a13 (diff) | |
better handling for when utf8 decoding fails
Diffstat (limited to 'python/architecture.py')
| -rw-r--r-- | python/architecture.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
