ability to send tweets containing unicode characters like cyrillic word 'тест'

This commit is contained in:
Eugen Pyvovarov 2010-12-08 02:39:06 -08:00
parent 5f1d0d4e90
commit 9133d0f10e

View file

@ -166,7 +166,7 @@ class Twython(object):
# Then open and load that shiiit, yo. TODO: check HTTP method and junk, handle errors/authentication
if fn['method'] == 'POST':
resp, content = self.client.request(base, fn['method'], urllib.urlencode(kwargs))
resp, content = self.client.request(base, fn['method'], urllib.urlencode(dict([k, v.encode('utf-8')] for k, v in kwargs.items())))
else:
url = base + "?" + "&".join(["%s=%s" %(key, value) for (key, value) in kwargs.iteritems()])
resp, content = self.client.request(url, fn['method'])