i3-companion: if SSID is not UTF-8 encoded, use replace

This commit is contained in:
Vincent Bernat 2021-07-12 08:52:26 +02:00
parent 0f2b12e228
commit 2773dfdedc

View file

@ -505,7 +505,7 @@ async def network_manager_status(i3, event, *args):
name = await nmap.Ssid
strength = int(await nmap.Strength)
status.append(""[strength // 34])
status.append(bytes(name).decode("utf-8"))
status.append(bytes(name).decode("utf-8", errors='replace'))
elif (
kind == NM_DEVICE_TYPE_ETHERNET
and state == NM_DEVICE_STATE_ACTIVATED