utf8-decode translation data

This commit is contained in:
jesopo 2019-09-24 12:47:16 +01:00
parent 8618f43b34
commit 195381d2e5

View file

@ -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,")