cramp-pub-sub-chat-demo icon indicating copy to clipboard operation
cramp-pub-sub-chat-demo copied to clipboard

the string received in server is wrong

Open cui-liqiang opened this issue 13 years ago • 4 comments

In file chat_action.rb:17, the received param 'data' messed up. See error below:

Yajl::ParseError: lexical error: invalid char in json text.
                          ??K\?0~t??5z?if7?$5{?g~`?..7?i
 (right here) ------^

Looks like some encode/decode issue.

cui-liqiang avatar Dec 24 '11 13:12 cui-liqiang

Same issue here with Chrome (16.0.912.63 beta, Sec-WebSocket-Version: 13) Works fine with FireFox (8.0, Sec-WebSocket-Version: 8) though.

127.0.0.1 - - [02/Jan/2012 14:24:55] "GET  HTTP/1.1" 200 - 0.0040
Yajl::ParseError: lexical error: invalid char in json text.
                                       ��͞�ٶ�������老�������㪨���
                     (right here) ------^

    /home/leucos/.rvm/gems/ruby-1.9.3-p0@webchat/gems/yajl-ruby-1.1.0/lib/yajl.rb:36:in `parse'

This happens here (gererated from index.erb, line 80):

    // send name when joining
    ws.onopen = function() {
      ws.send($.toJSON({ action: 'join', user: name }));
    }

Cramp::WebSocket probably doesn't support the latest drafts.

leucos avatar Jan 02 '12 13:01 leucos

this issue is gone in master branch. probably after websocket implementation has been replaced with faye-websocket.

edpratomo avatar Jan 23 '12 01:01 edpratomo

Nah, still there.

ariejan avatar Oct 02 '12 22:10 ariejan

Getting following error in FF 16.0.1 and Chrome 22.0.1229.94 on Ubuntu at chat_action.rb:58:in `parse_json'

Yajl::ParseError: lexical error: invalid char in json text.
                                       ����m�t�b�z�4�7�y�{�:�`�s�7�4
                     (right here) ------^

amitpatelx avatar Oct 26 '12 06:10 amitpatelx