2013-04-05 118 views
1

的API響應顯示特殊字符,而不是實際的話(實際的話是從泰米爾語)PHP捲曲擊中特殊字符

我應該在這個加什麼頭?請舉一些例子。

獲得特別象下面這樣:

கிழமை  

功能

function get_data($url) { 
    $ch = curl_init(); 
    $timeout = 5; 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); 
    $data = curl_exec($ch); 
    curl_close($ch); 
    return $data; 
} 
+0

最後我固定低於螺紋 [http://stackoverflow.com/questions/1198701/storing -and-displays-unicode-string-using-php-and-mysql] [1] [1]:http://stackoverflow.com/ques tions/1198701/stored-and-displays-unicode-string-using-php-and-mysql – Bharanikumar 2013-04-08 05:27:12

回答

0

您可能需要使用泰米爾語字符集。看看下面的鏈接:

http://www.iam.uni-bonn.de/~alt/html/unicode_25.html

將標題是這樣的:

$headers = array("Content-Type: application/x-www-form-urlencoded; charset: UTF-8"); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
curl_setopt($ch, CURLOPT_HEADER, 1); 
+0

感謝您的支持,我試過給出的代碼片段,但它沒有按照我的預期工作,以及您提供了參考URL,我不知道如何應用該URL在CURL中提到0B80這個代碼。請告知這一點。 – Bharanikumar 2013-04-05 16:29:20

+0

嘗試在上面的代碼片段中使用'charset:0B80'。 – Harpreet 2013-04-05 16:32:00

+0

$ headers = array(「Content-Type:application/x-www-form-urlencoded; charset:0B80」); curl_setopt($ ch,CURLOPT_HTTPHEADER,$ headers); curl_setopt($ ch,CURLOPT_HEADER,1);沒有工作,仍然是相同的特殊字符 – Bharanikumar 2013-04-05 16:39:08