diff --git a/knack/output.py b/knack/output.py index 110f1e0..bbe3277 100644 --- a/knack/output.py +++ b/knack/output.py @@ -160,6 +160,8 @@ def out(self, obj, formatter=None, out_file=None): # pylint: disable=no-self-us else: raise except UnicodeEncodeError: + logger.warning("Unable to encode the output with %s encoding. Unsupported characters are discarded.", + out_file.encoding) print(output.encode('ascii', 'ignore').decode('utf-8', 'ignore'), file=out_file, end='')