I'm having an hard time converting the output of a websocket connection to regular string and later to json.
Here is what a simple message looks like:
msg = await ws.recv()
print(msg)
b'\xabVJ-K\xcd+Q\xb2R*.M*N.\xcaLJU\xd2QJ\xceH\xcc\xcbK\xcd\x01\x89\x16\xe4\x97\xe8\x97d&g\xa7\x16Y\xb9\x86x\xe8\x86\x06\xbb\x84(\xd5\x02\x00'
I tried the following: print(str(msg, 'utf-8'))
But i got the following error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xab in position 0: invalid start byte
The same happens if i try .decode("utf-8")
Can anyone help me find what i'm doing wrong here? Thanks in advance!