init.py: Replace non-printable characters in stdout/stderr going to the message window

This commit is contained in:
gergely.erdelyi 2009-07-21 18:10:02 +00:00
parent 9876c4ffa7
commit 9530fbacfa

View File

@ -98,6 +98,8 @@ class MyStdOut:
Dummy file-like class that receives stout and stderr
"""
def write(self, text):
# Swap out the unprintable characters
text = text.decode('ascii', 'replace').encode('ascii', 'replace')
_idaapi.msg(text.replace("%", "%%"))
def flush(self):