Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    i cant see chinese and korean letters

    hi every body ... i have wrote php script to translate english statement to chinese by use altavista translator .. the problem is i cant see the korean or chinese words

    the script is

    header("Content-Type: text/html;charset=utf-8");
    $curl_handle=curl_init();
    curl_setopt($curl_handle,CURLOPT_URL,'http://babelfish.altavista.com/tr');
    $headers['Content-Type'] = 'text/html;charset=UTF-8';


    $postArr['doit'] = 'done' ;
    $postArr['intl'] = '1' ;
    $postArr['tt'] = 'urltext' ;
    $postArr['lp'] = 'en_ko'; //
    $postArr['trtext'] = "how are you everybody";
    $postArr['btnTrTxt'] = "Translate";


    curl_setopt($curl_handle, CURLOPT_POST, 1);
    curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $postArr);

    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER ,1);
    curl_setopt($curl_handle, CURLOPT_HEADER, 1);
    curl_setopt($curl_handle, CURLOPT_HTTPHEADER, $headers);

    $x = curl_exec($curl_handle);

    curl_close($curl_handle);

    $x = html2txt($x);

    $strStart = strpos($x,'*')+1;
    $strEnd = strpos($x,'Translate again') ;
    $strLength = $strEnd-$strStart ;
    $outputvalue = substr($x ,$strStart,$strLength);
    echo $outputvalue; /// this value ????? or nothing when translate to korean



    function html2txt($document){
    $search = array('@<script[^>]*?>.*?</script>@si', // Strip out javascript
    '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly
    '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
    '@<![\s\S]*?--[ \t\n\r]*>@' // Strip multi-line comments including CDATA
    );
    $text = preg_replace($search, '', $document);
    return $text;
    }


    i hope you can help please

  • #2
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    No body wana help !!!!

    what a stromg forum !!! .. nobody wana help me !!!!
    anyway thak you all


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •