PHP Classes

It doesn't work for asian language.

Recommend this page to a friend!

      Google Translate without API  >  All threads  >  It doesn't work for asian language.  >  (Un) Subscribe thread alerts  
Subject:It doesn't work for asian language.
Summary:It return bunch of ??????? marks when translating en to zh-CN
Messages:3
Author:andrew lee
Date:2012-08-28 21:37:21
Update:2012-09-17 02:51:18
 

 


  1. It doesn't work for asian language.   Reply   Report abuse  
Picture of andrew lee andrew lee - 2012-08-28 21:37:21
When translating from english to asian lanugage, I got bunch of ??????? marks. for example: from en to zh-CN(chinese simplified). Any idea why? thank you.

  2. Re: It doesn't work for asian language.   Reply   Report abuse  
Picture of Adnan Adnan - 2012-09-16 08:50:54 - In reply to message 1 from andrew lee
Add the line below before any output is sent to browser (i.e. at the top of your code):

header('Content-Type: text/html; charset=utf-8');

You are lucky... But I don't even get any output from the translate function. It returns nothing!

My code:

<?php
//for enabling utf-8 correctly
header('Content-Type: text/html; charset=utf-8');

require_once('class.google_translate.php');

$trans = new Google_Translate;
$trans->translate('Jeg er godt.');

?>

  3. Re: It doesn't work for asian language.   Reply   Report abuse  
Picture of andrew lee andrew lee - 2012-09-17 02:51:18 - In reply to message 2 from Adnan
I tried this already. it didn't work either.

translate "how are you" will return: ???&#65533;??

Not sure why.