From 4d6f6fb0385da4bba9b069deda16be95b0e9c51c Mon Sep 17 00:00:00 2001 From: Chrys Date: Sun, 25 Aug 2019 21:09:49 +0200 Subject: [PATCH] try fixing broken VCSU --- src/fenrirscreenreader/screenDriver/vcsaDriver.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fenrirscreenreader/screenDriver/vcsaDriver.py b/src/fenrirscreenreader/screenDriver/vcsaDriver.py index db8ba792..656f0655 100644 --- a/src/fenrirscreenreader/screenDriver/vcsaDriver.py +++ b/src/fenrirscreenreader/screenDriver/vcsaDriver.py @@ -217,7 +217,11 @@ class driver(screenDriver): self.autoDecodeVCSA(vcsaContent[4:], eventData['lines'], eventData['columns']) # VCSU seems to give b' ' instead of b'\x00\x00\x00' (tsp), deactivated until its fixed if vcsuContent != None: - eventData['text'] = screen_utils.insertNewlines(vcsuContent.decode('UTF-32', 'replace'), eventData['columns']) + try: + vcsuContentAsText = vcsuContent.decode('UTF-32') + eventData['text'] = screen_utils.insertNewlines(vcsuContentAsText, eventData['columns']) + except: + pass return eventData.copy() def updateCharMap(self, screen): self.charmap = {}