py3 decode order

This commit is contained in:
Dashie 2022-08-09 14:23:19 +02:00
parent d9fc52bf48
commit 22973d7036
No known key found for this signature in database
GPG Key ID: C2D57B325840B755
1 changed files with 2 additions and 3 deletions

View File

@ -59,10 +59,9 @@ class AprsISConnection(aprslib.IS):
""" """
def filterCallback(line): def filterCallback(line):
try: try:
# py3: this seems to somehow break the packets ? # decode first then replace
# line = line.replace('\x00', '')
# just do a decode to do str->bytes
line = line.decode() line = line.decode()
line = line.replace('\x00', '')
except UnicodeError as e: except UnicodeError as e:
# string is not UTF-8 # string is not UTF-8
return return