Jun-24-2021, 03:50 PM
I'm trying to convert bytes from the recvfrom function to text but i get this error:
The code I'm using is
Error:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xac in position 4: invalid start byte
with different byte that gives the error.The code I'm using is
import socket import time import struct import sys s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_TCP) while a: raw_data, addr = s.recvfrom(65565) print(raw_data.decode("utf-8"))Can someone help?