If you try and send a message with new messaging app that contains a
comma in the message it does not work in Safari.

I'm not really sure why the json encoded message is not working in the
Safari browser, but I fixed it by adding a base64 encode and decode
step that encodes/decodes the message string.

def _encode(self, messages, encode_empty=False):
        if messages or encode_empty:
            for message in messages:
                message.message = base64.b64encode(message.message)
            encoder = MessageEncoder(separators=(',', ':'))

def _decode(self, data):
                messages = json.loads(value, cls=MessageDecoder)
                for message in messages:
                    message.message = base64.b64decode
                return messages
            except ValueError:


You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to