-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
处理含中文的文件,但是文件字符集为iso88591的时候,程序直接close #10
Comments
`[xsank.mz@myhost /home/xsank.mz] [xsank.mz@myhost /home/xsank.mz] [xsank.mz@myhost /home/xsank.mz] |
[root@node96 ~]# env |grep LANG
我的环境,没有啥特殊的地方了. |
test-iso88591.txt 我测试的2个文件. |
看起来是websocket客户端收到非utf-8编码时自己主动close的,白天工作比较苦逼,晚上我查查这个问题 |
行,xsank,辛苦了.:) |
看起来在javascript的websocket的onmessage方法中是没办法处理这个问题的,这个方法收到的数据已经是parse过frame的数据了,抛错在此方法之前 临时解决方案: |
utf-8编码应该是支持websocket的浏览器硬性要求的,目前只能应用层处理或者换修复此问题的浏览器 |
亲测了这个example,好像没有这个编码的问题. |
继续关注...... |
好的,刚开始上班,这周应该有空的,你说的这个例子我看看 |
我试了下这个插件,貌似也没有编码方面的问题(还支持复制,粘贴).好像是基于hterm开发的.也是脚本实现的.非term.js |
1 similar comment
我试了下这个插件,貌似也没有编码方面的问题(还支持复制,粘贴).好像是基于hterm开发的.也是脚本实现的.非term.js |
这个好像是基于hterm开发的 |
給你发了,关于hterm的mail,请查收.供参考. |
如何了@xsank |
中文字符编码不是utf-8,程序直接close的问题,求指教@someonebw,@xsank |
test-iso88591.txt: text/plain; charset=iso-8859-1
test-utf-8.txt: text/plain; charset=utf-8
[root@node96 test]# hexdump -C test-utf-8.txt
00000000 74 65 73 74 c3 96 c3 90 |test....|
00000008
[root@node96 test]# hexdump -C test-iso88591.txt
00000000 74 65 73 74 d6 d0 |test..|
00000006
在页面上面会报错,websocket被close
WebSocket connection to 'ws://x.x.x.x:9527/ws' failed: Could not decode a text frame as UTF-8.
The text was updated successfully, but these errors were encountered: