From: John Runyon Date: Sat, 23 Mar 2024 06:34:36 +0000 (-0600) Subject: use surrogateescape instead of backslashreplace so bad utf8 will get passed through X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/c9c79ad54d32ab444581bd5a19f85d8b36834bcd use surrogateescape instead of backslashreplace so bad utf8 will get passed through --- diff --git a/bot.py b/bot.py index 410003f..fbb3999 100644 --- a/bot.py +++ b/bot.py @@ -588,7 +588,7 @@ class BotConnection(object): self.parent.log('X', line) def _write(self, line): - self.socket.sendall(line.encode('utf-8', 'backslashreplace')+b"\r\n") + self.socket.sendall(line.encode('utf-8', 'surrogateescape')+b"\r\n") def _getsockerr(self): try: # SO_ERROR might not exist on all platforms