fixed network based decoding of string

This commit is contained in:
DJ2LS 2023-05-28 12:33:43 +02:00
parent f160775ec0
commit 1343d6e7ea

View file

@ -777,8 +777,8 @@ class ThreadedTCPRequestHandler(socketserver.StreamRequestHandler):
for _, route in enumerate(MeshParam.routing_table):
output["routes"].append(
{
"dxcall": str(MeshParam.routing_table[_][0], "utf-8"),
"router": str(MeshParam.routing_table[_][1], "utf-8"),
"dxcall": MeshParam.routing_table[_][0].decode('utf-8'),
"router": MeshParam.routing_table[_][1].decode('utf-8'),
"hops": MeshParam.routing_table[_][2],
"snr": MeshParam.routing_table[_][3],
"score": MeshParam.routing_table[_][4],
@ -1152,8 +1152,8 @@ def send_tnc_state():
for _, route in enumerate(MeshParam.routing_table):
output["routing_table"].append(
{
"dxcall": str(MeshParam.routing_table[_][0], encoding),
"router": str(MeshParam.routing_table[_][1], encoding),
"dxcall": MeshParam.routing_table[_][0].decode('utf-8'),
"router": MeshParam.routing_table[_][1].decode('utf-8'),
"hops": MeshParam.routing_table[_][2],
"snr": MeshParam.routing_table[_][3],
"score": MeshParam.routing_table[_][4],