]> jfr.im git - erebus.git/commitdiff
use surrogateescape instead of backslashreplace so bad utf8 will get passed through
authorJohn Runyon <redacted>
Sat, 23 Mar 2024 06:34:36 +0000 (00:34 -0600)
committerJohn Runyon <redacted>
Sat, 23 Mar 2024 06:34:36 +0000 (00:34 -0600)
bot.py

diff --git a/bot.py b/bot.py
index 410003f0a9fa1bf79fdbe814d6909c2cb0f9daa9..fbb399991ddba703dc4ff821926de7bc2659d101 100644 (file)
--- 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