diff --git a/mail_to_misp.py b/mail_to_misp.py index 345a7d3..af77a1b 100755 --- a/mail_to_misp.py +++ b/mail_to_misp.py @@ -353,7 +353,7 @@ if __name__ == '__main__': sys.exit(-1) if args.infile: - pseudofile = BytesIO(args.infile.read().encode()) + pseudofile = BytesIO(args.infile.read().encode('utf8', 'surrogateescape')) elif args.read: # read from tempfile with open(args.read, 'rb') as f: