Problems With Receiving 'utf-8' From Client
I am trying to create a 2-way communication between server and client using Flask and socket.io. Everything works fine until server receives utf-8 string from client, which gets ga
Solution 1:
You are using the 1.x versions of the Socket.IO client, which had known problems with double-encoding of UTF-8 strings. You should try the 2.x versions which have resolved this issue.
Solution 2:
It seems that I was getting back a mojibake decoded using latin-1
and encoded with utf-8
.
To fix this, I added:
json_str = json_str.encode('latin-1').decode('utf-8')
If you are having this problem, take a look at Miguel's answer.
Solution 3:
I used servers socket.io js file from reverse proxy by adding socket.io.js end of reverse proxy path like this xxx.com/reverse_proxy_path/socket.io
Post a Comment for "Problems With Receiving 'utf-8' From Client"