Encoding need for Google API

3 views (last 30 days)
hanan
hanan on 8 Jun 2011
I'm trying to use my script to automatically using Google translate APIs from Arabic to english. Here is the code.
mytext = {some text in Arabic}
url = 'http://translate.google.com/translate_t';
page = urlread(url, 'get' ,{'v', '1.0','ie', 'UTF8','oe', 'UTF8','q', native2unicode(mytext,'utf8'), ...'langpair', ['ar' '|' 'en']});
Now I've tried using various encodings for mytext, including unicode, utf-8 but it never works. and the text send to Google API as ????? .Any idea if I need any codec?

Answers (1)

Walter Roberson
Walter Roberson on 8 Jun 2011
5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Google, unless you have been specifically allowed to do so in a separate agreement with Google. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.
  3 Comments
Walter Roberson
Walter Roberson on 9 Jun 2011
If you try to do something you are prohibited from doing and it fails, then inquiring as to how to get around the technical problem is not the correct approach.
I believe you should be going back to the googleapis version.
hanan
hanan on 9 Jun 2011
OK, Is there any alternative way to use other translator with MATLAB?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!