[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Google Translate API's
Hi Scott,
thanks,
it worked, as long as I dosn't specify any local (danish) characters,
by the way I'm on a CCSID 277 both in QCCSID, Job CCSID and source
CCSID - and I run on a standard LIBHTTP installation.
"Prøve" should convert to "Trial" (from danish to english), as
standard
LIBHTTP escapes this to Pr%F8ve and google will return garbage
but run it on return code 200
Then I added
HTTP_setCCSIDs(1208:0:1208:0);
and LIBHTTP converted "Prøve" to "Pr%C3%B8%85" that became "Test"
because
the right encodeURI should be "pr%C3%B8ve"
Then I tried with a longer sentence ...
"Årlig vedligeholdelse" should convert to "Yearly Maintenance", the
correct encodeURI should be "%C3%85rlig%20vedligeholdelse" but that
became
"%C3%85e%C3%81Ca%C3%A4%2FCu%07%C3%A4%C3%8D CuC" and gave me return
code 400
It seems to me, that iConv, first started to encode, never stops and
produces
garbage :-(
FYI, during the day I found som specialities in what google returns,
because it's a service that is expected to be run from an AJAX call.
Even though they return's a HTTP code 400, there is a hidden message
explaining
the error, a JSON object that cannot be seen in your log, but can be
seen
in a browser (FF), something called X-embedded-status:
Your log:
<HTML>
<HEAD>
<TITLE>Bad Request</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Bad Request</H1>
<H2>Error 400</H2>
</BODY>
</HTML>
The hidden embedded JSON message on the above:
{"responseData": null, "responseDetails": "invalid translation
language pair", "responseStatus": 400}
Try this with an error in langpair:
http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=al
fanumerisk%20oversat&langpair=daen
If you have any explanation, please enligthen me
Thanks
Regards
Henrik
Scott Klement <sk@xxxxxxxxxxxxxxxx>
Sent by: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
24-07-2009 18:37
Please respond to
HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
To
HTTPAPI and FTPAPI Projects <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
cc
Subject
Re: Google Translate API's
Hello Henrik,
Please try changing your call to http_url_get() to look like this:
rc = http_url_get(url: '/tmp/testpost.html');
You are specifying some other parameters that are likely to be causing
problems. Try specifying only those two.
Thanks!
----------------------------------------------------------------------
-
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
----------------------------------------------------------------------
-
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------