mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
handle strange unicode characters ;)
This commit is contained in:
parent
f130de7e77
commit
71e3064574
1 changed files with 2 additions and 2 deletions
|
|
@ -294,7 +294,7 @@ async def handle_log_rx(event):
|
||||||
chan_name = channel["channel_name"]
|
chan_name = channel["channel_name"]
|
||||||
aes_key = bytes.fromhex(channel["channel_secret"])
|
aes_key = bytes.fromhex(channel["channel_secret"])
|
||||||
cipher = AES.new(aes_key, AES.MODE_ECB)
|
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 != "" :
|
if chan_name != "" :
|
||||||
width = os.get_terminal_size().columns
|
width = os.get_terminal_size().columns
|
||||||
|
|
@ -324,7 +324,7 @@ async def handle_log_rx(event):
|
||||||
if flags & 0x40 > 0: #has feature2
|
if flags & 0x40 > 0: #has feature2
|
||||||
adv_feat2 = pk_buf.read(2).hex()
|
adv_feat2 = pk_buf.read(2).hex()
|
||||||
if flags & 0x80 > 0: #has name
|
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:
|
if adv_name is None:
|
||||||
# try to get the name from the contact
|
# try to get the name from the contact
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue