Well you can try to, but it will end up almost probably in an disconnect which is caused by the browser.
As i have learned here.
Given you have a string which contains invalid unicode like:
This will trouble the browser and the socket connection.
If you prepare your json with PHP and json_encode the Unicode will be escaped to some strings like these:
\ud83d\ude31\ud83d\ude31\ud83d\ude04\ud83d\ude04\ud83d\udc9c\ud83d\udc9c\ud83d\udc4a
But on clientside it will still result in invalid Unicode.
Continue reading “Sending invalid Unicode via socket.io”