From 6002722c7ea2e43817eee4ef74f1b81ef2f97695 Mon Sep 17 00:00:00 2001 From: Fernando Date: Sat, 22 Nov 2014 11:49:19 -0200 Subject: [PATCH] Fix invalid continuation byte for webapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I get this error when using API: {"result":"error", "message": "error while composing output: "utf8 : terça 9:00 : error 3 : error 4 : invalid continuation byte"} There's a special char "TERÇA" Don't know why this happens. I had a special date style and even after change it to "yyyy-mm-dd" this error still happens. Don't know why the api builder is still using the translated week day. Also timezone is set to "network" This error only happens when missing/future has "terça" - Tuesday and "sábado" - saturday weekdays. The other week days there's no special char. --- sickbeard/webapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index 71f8683c..bfd051fa 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -163,7 +163,7 @@ class Api(webserve.MainHandler): def _out_as_json(self, dict): self.set_header("Content-Type", "application/json") try: - out = json.dumps(dict, indent=self.intent, sort_keys=True) + out = json.dumps(dict, indent=self.intent,ensure_ascii=False,sort_keys=True) if 'jsonp' in self.request.query_arguments: out = self.request.arguments['jsonp'] + '(' + out + ');' # wrap with JSONP call if requested