From 1f13ae0f78cbc98b4b004014476590179c979847 Mon Sep 17 00:00:00 2001 From: Brose Johnstone Date: Sat, 29 Jan 2022 22:23:23 -0800 Subject: [PATCH] Obok: Fix invalid UTF-8 causing UI to not open For some reason, the title of a book on my device causes Obok to choke. Apparently it's not valid UTF-8. This fixes that by ignoring decode errors. --- Obok_plugin/obok/obok.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Obok_plugin/obok/obok.py b/Obok_plugin/obok/obok.py index 403db27..e95e8d1 100644 --- a/Obok_plugin/obok/obok.py +++ b/Obok_plugin/obok/obok.py @@ -352,6 +352,7 @@ class KoboLibrary(object): olddb.close() self.newdb.close() self.__sqlite = sqlite3.connect(self.newdb.name) + self.__sqlite.text_factory = lambda b: b.decode("utf-8", errors="ignore") self.__cursor = self.__sqlite.cursor() self._userkeys = [] self._books = []