From 6997508a0cfd9ce4899c7f96aaf5a98017d7948c Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 21 Jan 2021 08:41:35 -0500 Subject: [PATCH] Fallback to forced utf8 on unicodeerror If LC_ALL is set to C, then unicode can be a problem. --- confluent_client/bin/confetty | 2 ++ 1 file changed, 2 insertions(+) diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index 8593eebd..562acb0a 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -948,6 +948,8 @@ def main(): clearpowermessage = False try: sys.stdout.write(data) + except UnicodeEncodeError: + sys.stdout.buffer.write(data.encode('utf8')) except IOError: # Some times circumstances are bad # resort to byte at a time... for d in data: