From 195381d2e531f40f3206e68a7de6f0e293feb6fd Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 24 Sep 2019 12:47:16 +0100 Subject: [PATCH] utf8-decode translation data --- modules/translate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/translate.py b/modules/translate.py index b2296c10..b12f0d0a 100644 --- a/modules/translate.py +++ b/modules/translate.py @@ -38,8 +38,8 @@ class Module(ModuleManager.BaseModule): "client": "gtx", "sl": source_language, "tl": target_language, "dt": "t", "q": phrase}) - if page and not page.data.startswith("[null,null,"): - data = page.data + if page and not page.data.startswith(b"[null,null,"): + data = page.data.decode("utf8") while ",," in data: data = data.replace(",,", ",null,") data = data.replace("[,", "[null,")