Menu

#18 It doesn't support UTF-8 in outgoing messages

closed
nobody
None
5
2012-07-26
2012-07-08
Anonymous
No

In irclib.py function send_raw(self, string) I replaced

self.socket.send(string + "\r\n")

with

self.socket.send(string.encode('utf-8') + "\r\n")

and now I can use UTF-8

Should be enhanced :-)

Discussion

  • Jason R. Coombs

    Jason R. Coombs - 2012-07-08

    Fixed in 767aae4831f5. Please test with the latest code and re-open if the fix doesn't work as expected.

     
  • Ludovic Belliere

    You shouldn't force utf8 on users, rather use an additional argument in send_raw() or its object.

     
  • Jason R. Coombs

    Jason R. Coombs - 2012-07-09

    That's a good point. The previous behavior probably used the 'default encoding' of the system, which for Python 3 is 'utf-8' and Python 2 is 'ascii'.

    Submitter - would setting the default encoding (for the Python environment) address your concern (without the change to the code)?

    I realize now that some users may have already taken advantage of the default encoding, so making this change will break compatibility.

    I'm warming to the idea of having an 'encoding' property in the Connection class, but I'm tempted to omit encoding support altogether if relying on the system's default encoding is sufficient.

     
Monday.com Logo