I am sending a PHP CURL call to send english text to be returned in french. The french accent character comes back with improper coding.
Here is the code:
$url = 'https://www.googleapis.com/language/translate/v2?key='.$api_key.'&q='.rawurlencode($text);
$url .= '&target='.$target;
if($source) $url .= '&source='.$source;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);If I send the text of: Be sure that your students love and know you
I get back: Assurez-vous que vos élèves aiment et vous savez
If I manually go out to: http://translate.google.com I get this. Assurez-vous que vos élèves aiment et vous savez
I know it's an issue with the UTF-8 Encoding, but I'm not sure how to get it to correctly display.
Any hints would be helpful.
Thanks.