2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-02 12:04:46 +00:00

Fix non-ascii unicode handling of consoles

This commit is contained in:
Jarrod Johnson 2018-07-12 14:16:44 -04:00
parent c925353f02
commit 0f3014957b

View File

@ -59,11 +59,12 @@ def _unicode_list(currlist):
def send(handle, data):
if isinstance(data, str) or isinstance(data, unicode):
if isinstance(data, unicode):
try:
data = data.encode('utf-8')
except AttributeError:
pass
if isinstance(data, str) or isinstance(data, unicode):
# plain text, e.g. console data
tl = len(data)
if tl == 0: