activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 雷钦 (JIRA) <j...@apache.org>
Subject [jira] [Commented] (APLO-355) Stomp Websocke example doesn't work for utf-8 String
Date Sun, 27 Apr 2014 11:02:15 GMT

    [ https://issues.apache.org/jira/browse/APLO-355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13982292#comment-13982292
] 

雷钦 commented on APLO-355:
-------------------------

I add the test case and create a pull request

https://github.com/apache/activemq-apollo/pull/3

the test cast output is here : https://gist.github.com/leiqin/11342525

I notice when I send '你好' from broker to client , the client receive 'ä½ å¥½'

this is something try with python shell:

>>> '你好'
'\xe4\xbd\xa0\xe5\xa5\xbd'
>>> u'你好'
u'\u4f60\u597d'
>>> 'ä½ å¥'
'\xc3\xa4\xc2\xbd \xc3\xa5\xc2\xa5'
>>> u'ä½ å¥'
u'\xe4\xbd \xe5\xa5'
>>> print u'\xe4\xbd\xa0\xe5\xa5\xbd'
你好

I think may be the borker read by byte from utf-8 string and send the bytes as utf-8 string
to websocket,
and do the reverse when it receive message from websocket .

> Stomp Websocke example doesn't work for utf-8 String
> ----------------------------------------------------
>
>                 Key: APLO-355
>                 URL: https://issues.apache.org/jira/browse/APLO-355
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>          Components: apollo-stomp
>    Affects Versions: 1.7
>         Environment: apache-apollo-1.7
> linux debian testing
> iceweasel 24.4.0 chromium 33.0.1750.152
>            Reporter: 雷钦
>
> when I send a utf-8 String to Char Room ,  it not receive what I send , for example:
> I send : 你好
> the Debug Log is :
> >>> SEND
> destination:/topic/chat.general
> content-length:2
> 你好
> <<< MESSAGE
> subscription:sub-0
> message-id:apollo-broker-312
> destination:/topic/chat.general
> content-length:2
> `}
> I receive '`}' not '你好'
> then , I found the content-length is not correct in utf-8 ,in utf-8 '你好' has 6 byte
.
> then I change the js/stomp.js to use https://github.com/jmesnil/stomp-websocket
> I see the Debug Log is :
> >>> SEND
> destination:/topic/chat.general
> content-length:6
> 你好
> the content-length is correct , but I didn't receive any message .
> after a while , the Debug Log show me :
> <<< ERROR
> message:Expected null terminator after 6 content bytes
> Whoops! Lost connection to ws://localhost:61623/



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message