Note: for support questions, please use one of these channels: stackoverflow or slack
when emitting an object as data and within it using a string of ≥
(or the unicode \u2265
) it turns it to the string letter e
and ≤
trurns to d
client side
channel.emit('data', {data:'≥'});
server side
socket.on('data',({data:bla})=>{
console.log(bla); // prints 'e'
});
Note: the best way to get a quick answer is to provide a failing test case, by forking the following fiddle for example.
that the data will stay the same consistently
This happens only when the socket hasn't upgraded (first use) over xhr,
after it upgrades to websocket all data is sent correctly
see #451 and #572
There was an issue regarding utf8 parsing in version 1.x, could you please try with version 2.x ?
Related:
tried it with 2.0.4, still happens...
fixed it with encoding and decoding the data with this code:
client side
function strencode( data ) {
return encodeURIComponent( escape( JSON.stringify( data ) ) );
}
server side
function strdecode( data ) {
return JSON.parse( unescape( decodeURIComponent( data ) ) );
}
Yeah that's seems to be working. Thanks!
Most helpful comment
tried it with 2.0.4, still happens...
fixed it with encoding and decoding the data with this code:
client side
server side