I'm trying to use my script to automatically using google translate apis from russian to english. Here is the code.
mytext = {some text in russian}
url = 'https://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q='+ mytext +'&langpair=ru%7Cen'
request = urllib2.Request(url, None, {'Referer': 'http://www.mysite.org'})
Now I've tried using various encodings for mytext, including unicode, utf-8, windows-1251 but it never works. Either the urllib.request complains of non-ascii characters or google returns an error code. Any idea if I need any codec?