我有一个javascript发送unicode星字符。在
但python在控制台和日志文件中都将其解释为字母和。在
其他unicode字符的格式也不正确。在
var ws = new WebSocket("ws://127.0.0.1:8888/");
ws.onopen= function(){
console.log('\u2605');
ws.send('\u2605');
ws.close();
}
python代码:
^{pr2}$使用的WebsocketServer库:https://github.com/Pithikos/python-websocket-server
有人知道这里有什么问题吗?在
编辑:
刚在git hub上找到此页面:
https://github.com/Pithikos/python-websocket-server/issues/19
这似乎是lib问题,一些用户发布了解决方案:
bytes([i^masks[idx % 4] for idx, i in enumerate(self.read_bytes(payload_length))]).decode()
但是,我完全不知道该把代码放在哪里。在
非常感谢你的帮助。在
在WebsocketServer库代码中:
应替换为:
^{pr2}$相关问题 更多 >
编程相关推荐