Skip to content

Commit 07b83e9

Browse files
committed
In translate() function, changed text to be translated in parameters dictionary to UTF-8 encoding. Conversion is needed to allow Japanese strings to be passed to urlencode().
1 parent 52ee9ad commit 07b83e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def translate(self, text, to_lang, from_lang=None,
8282
supported category is "general".
8383
"""
8484
params = {
85-
'text': text,
85+
'text': text.encode('utf8'),
8686
'to': to_lang,
8787
'contentType': content_type,
8888
'category': category,

0 commit comments

Comments
 (0)