handle the UnicodeEncodeError of Log.stdout & Log.stderr()