but if change data to this:
data = {'q':u'ponúkam'.encode('utf-8'), 'key':'AIzaSyBdX-
C6OgCQK8sHGF_VXpkMyJNqiSrPcUk', 'target':'en', 'source':'sk'}
it works.
But still don't understand why my "old way" worked in past. Guess i'll
have to try to rewrite my scripts.
Thanks Jeremy
Radovan
On 10. Mar., 08:47 h., urukay <[email protected]> wrote:
> No thats not the problem i think:
>
> url ='https://www.googleapis.com/language/translate/v2'
> data = {'q':'ponúkam', 'key':'...', 'target':'en', 'source':'sk'}
> req = urllib2.Request(url=url, data=urllib.urlencode(data))
> req.add_header('X-HTTP-Method-Override', 'GET')
>
> and the result is the same. As i wrote tried almost everything, but
> still this problem occures although couple months ago everything was
> ok.
> Or am i missing something?
>
> Thanks
>
> Radovan
>
> On 9. Mar., 20:40 h., Jeremy Geerdes <[email protected]> wrote:
>
> > The Translate API is set to process UTF-8 encoding, but in order to pass
> > them to the translator, whether via GET or POST, the UTF-8 also needs to be
> > urlencoded.
>
> > Jeremy R. Geerdes
> > Generally Cool Guy
> > Des Moines, IA
>
> > For more information or a project quote:
> > [email protected]
>
> > If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan
> > Church!
>
> > On Mar 9, 2011, at 10:15 AM, urukay wrote:
>
> > > Hi,
>
> > > just find out that the translate api v2 is ignoring non-ascii
> > > characters in strings.
>
> > > if i send:
> > > urllib2.urlopen('https://www.googleapis.com/language/translate/v2?
> > > q=ponúkam&source=sk&target=en&key=...')
> > > or
> > > urllib2.urlopen('https://www.googleapis.com/language/translate/v2?
> > > &q=pon\xfakam&source=sk&target=en&key=...')
>
> > > it translates word 'ponkam' but not the right word 'ponúkam'. It is
> > > the same for GET and POST methods.
>
> > > Tried almost everything, changed encodings, quote string etc, but
> > > nothing works. But couple months ago, everything was ok.
>
> > > Is it a bug? Has anyone faced this problem?
>
> > > Thanks
>
> > > Radovan
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google AJAX APIs" group.
> > > To post to this group, send email to
> > > [email protected].
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group
> > > athttp://groups.google.com/group/google-ajax-search-api?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en.