我的代码
import socket
BUFFER_SIZE = 1024
HOST = '192.168.1.3'
PORT = 5555 # Port to listen on (non-privileged ports are > 1023)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen(10)
while 1:
conn, addr = s.accept()
with conn:
print('Connected by', addr[0] + ":" + str(addr[1]))
msg = conn.recv(BUFFER_SIZE)
print(msg.decode('UTF-8'))
当我执行 我打印的代码 (msg.decode (encoding = 'UTF-8', errors = 'strict')) UnicodeDecodeError: 'utf-8' 编解码器无法解码位置 6 的字节 0x8b:起始字节无效 你可以帮我