From b8d697a21df33f82744ee8c2790338de060d8a07 Mon Sep 17 00:00:00 2001 From: Yiqing Zhang Date: Thu, 15 Dec 2016 16:23:17 +1100 Subject: [PATCH] fix error when handling the extended ASCII codes in response output --- pycorenlp/corenlp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pycorenlp/corenlp.py b/pycorenlp/corenlp.py index 6eb2175..990b077 100644 --- a/pycorenlp/corenlp.py +++ b/pycorenlp/corenlp.py @@ -27,6 +27,7 @@ def annotate(self, text, properties=None): self.server_url, params={ 'properties': str(properties) }, data=data, headers={'Connection': 'close'}) + r.encoding = 'utf-8' output = r.text if ('outputFormat' in properties and properties['outputFormat'] == 'json'):