Replace any characters that cannot be decoded with a replacement marker in the DX cluster frame. Addresses issue #45.

pull/54/head
Christian T. Jacobs 2017-02-07 20:33:14 +00:00
rodzic 08d21627e2
commit ce46c14096
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -309,7 +309,8 @@ class DXCluster(Gtk.VBox):
:rtype: bool
"""
if(self.connection):
text = self.connection.read_very_eager().decode()
text = self.connection.read_very_eager()
text = text.decode("ascii", "replace") # Replace any characters that cannot be decoded with a replacement marker.
try:
text = text.replace("\u0007", "") # Remove the BEL Unicode character from the end of the line
except UnicodeDecodeError: