Convert to string

merge-requests/21/head
Bob Mottram 2021-03-15 19:10:08 +00:00
parent 31da9c98f5
commit f7f17aef4a
1 changed files with 4 additions and 4 deletions

View File

@ -452,8 +452,8 @@ def _showLocalBox(notifyJson: {}, boxName: str,
while len(posStr) < 3: while len(posStr) < 3:
posStr += ' ' posStr += ' '
if speakerJson.get('name'): if speakerJson.get('name'):
udata = speakerJson['name'].decode("utf-8") udata = speakerJson['name']
name = udata.encode("ascii","ignore") name = str(udata.encode("ascii", "ignore"))
else: else:
name = '' name = ''
if len(name) > 16: if len(name) > 16:
@ -461,8 +461,8 @@ def _showLocalBox(notifyJson: {}, boxName: str,
else: else:
while len(name) < 16: while len(name) < 16:
name += ' ' name += ' '
udata = speakerJson['content'].decode("utf-8") udata = speakerJson['content']
content = udata.encode("ascii","ignore") content = str(udata.encode("ascii","ignore"))
if speakerJson.get('detectedLinks'): if speakerJson.get('detectedLinks'):
if len(speakerJson['detectedLinks']) > 0: if len(speakerJson['detectedLinks']) > 0:
content = '🔗' + content content = '🔗' + content