From 5ae8b82a6c8f8263505fe6fcc2be26aac81c5052 Mon Sep 17 00:00:00 2001 From: Ivan Yurchenko Date: Sun, 13 Nov 2022 11:28:37 +0200 Subject: [PATCH] ui: handle UTF-8 encoding errors --- pyheap-ui/src/pyheap_ui/heap_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyheap-ui/src/pyheap_ui/heap_reader.py b/pyheap-ui/src/pyheap_ui/heap_reader.py index ebf0166..4ee61fa 100644 --- a/pyheap-ui/src/pyheap_ui/heap_reader.py +++ b/pyheap-ui/src/pyheap_ui/heap_reader.py @@ -366,7 +366,7 @@ def _read_string_with_known_length(self, length: int) -> str: r = struct.unpack_from(fmt, self._buf, self._offset)[0] self._offset += struct.calcsize(fmt) - return r.decode("utf-8") + return r.decode("utf-8", "backslashreplace") @cache def _get_string_struct(self, length: int) -> struct.Struct: