From 71e30645742ca5f5906f6f7f47ba0ecaaf009c63 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 12 Dec 2025 19:46:19 +0100 Subject: [PATCH] handle strange unicode characters ;) --- src/meshcore_cli/meshcore_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index fb19b3e..6561c9f 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -294,7 +294,7 @@ async def handle_log_rx(event): chan_name = channel["channel_name"] aes_key = bytes.fromhex(channel["channel_secret"]) cipher = AES.new(aes_key, AES.MODE_ECB) - message = cipher.decrypt(msg)[5:].decode("utf-8").strip("\x00") + message = cipher.decrypt(msg)[5:].decode("utf-8", "ignore").strip("\x00") if chan_name != "" : width = os.get_terminal_size().columns @@ -324,7 +324,7 @@ async def handle_log_rx(event): if flags & 0x40 > 0: #has feature2 adv_feat2 = pk_buf.read(2).hex() if flags & 0x80 > 0: #has name - adv_name = pk_buf.read().decode("utf-8").strip("\x00") + adv_name = pk_buf.read().decode("utf-8", "ignore").strip("\x00") if adv_name is None: # try to get the name from the contact