API translation not the same as http://translate.google.com

128 views
Skip to first unread message

tigercode

unread,
Aug 5, 2012, 11:38:44 AM8/5/12
to google-tra...@googlegroups.com
Here is an example.

I have a simple English test string I'm trying to translate to Spanish using code to work with the google API.

English test sting = where is your home
translate to Spanish using http://translate.google.com = ¿dónde está su casa
translate to Spanish using API =
¿dónde está su casa

in my google API response the Spanish text characters are not correct. I don't know why?

Thank you very much
- tigercode

João Martins

unread,
Aug 28, 2012, 11:39:38 AM8/28/12
to google-tra...@googlegroups.com
Translate API is returning your text encoded in UTF8, yet you are reading it in Latin1 (ISO-8859-1). For instance, in UTF8, the character 'á' is encoded into two bytes, C3 A1. In ISO-8859-1, C1 is decoded to  and A1 is ¡. Change the encoding of your text reader to UTF8 and it should work.

iona

unread,
Sep 20, 2012, 3:47:49 AM9/20/12
to google-tra...@googlegroups.com
vreu   sá   imi gásec de  lucru  dacá  cineva má pote  ajuta  ,má pricep la in grijirea bárinilor la curátenie  ,am32 de ani stiu 3 libe romineste  ungureste si spaniolá ,si am permis  cate  b ,  vá multumesc ,si astept  sámi scrieci  .
Reply all
Reply to author
Forward
0 new messages