From eadad1405fbb5dc7791e32fc855b3ad7fed9b9bc Mon Sep 17 00:00:00 2001 From: Guy Dupont <dupontgu@gmail.com> Date: Mon, 11 Sep 2023 14:45:39 -0400 Subject: [PATCH] Use better supported method for decoding bytearray to string --- code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code.py b/code.py index cbb17ec..45eb36e 100644 --- a/code.py +++ b/code.py @@ -49,7 +49,7 @@ if message_length > 0: try: - message_string = bytearray(message_bytes[0:message_length]).decode("utf-8") + message_string = str(bytearray(message_bytes[:message_length]), 'utf-8') print(message_string) except: print("Couldn't decode as UTF 8")