Issue #5 resolved

Encoding issue when sending non-ascii message

created an issue

When trying to send a non-ascii message to a websocket, I get this:

File "/home/juanlu/Development/Python/sage/reloaded/lib/python2.7/site-packages/geventwebsocket/", line 21, in send message = unicode(message).encode('utf-8') UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)

as the default encoding in Python 2.x is ascii. This:

message = unicode(message, 'utf-8').encode('utf-8')

will work.

Comments (3)

  1. Log in to comment