Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

SockJSSubscriber raise 'UnicodeEncodeError' Exception #63

Open
cloverstd opened this issue Apr 26, 2014 · 3 comments
Open

SockJSSubscriber raise 'UnicodeEncodeError' Exception #63

cloverstd opened this issue Apr 26, 2014 · 3 comments

Comments

@cloverstd
Copy link

Hi,
I am writing a realtime web application with SockJSSubscriber.
When I send a unicode string that exceed ASCII's coding range, like Chinese character, there will raise UnicodeEncodeError Exception on 'tornadoredis/pubsub.py", line 146, in on_message'.

[Solutions]
I inherit a SockJSSubscriber and overwrite the on_message to encode the msg.body to str, and it work well.

@leporo
Copy link
Owner

leporo commented Apr 27, 2014

Please clarify: have you removed the str() type casting/encoding from the line 146?

@cloverstd
Copy link
Author

@leporo
No, I have not modified the source of tornado-redis.
You can test a Chinese charater like u"你好"(means hello) or u'\u4f60\u597d'.

@leporo
Copy link
Owner

leporo commented Apr 28, 2014

Could you please try the current master branch? Does it work for you?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants