Filter non-ASCII input when not in binary mode
[mudpy.git] / mudpy / misc.py
index 439e00a..009de29 100644 (file)
@@ -883,8 +883,8 @@ class User:
                 line = line.strip()
 
                 # log non-printable characters remaining
-                if mudpy.telnet.is_enabled(self, mudpy.telnet.TELOPT_BINARY,
-                                           mudpy.telnet.HIM):
+                if not mudpy.telnet.is_enabled(
+                        self, mudpy.telnet.TELOPT_BINARY, mudpy.telnet.HIM):
                     asciiline = bytes([x for x in line if 32 <= x <= 126])
                     if line != asciiline:
                         logline = "Non-ASCII characters from "