The API response is displaying special characters instead of actual words (the actual words are from the tamil language)
What header should I add in this? Please provide some example.
Getting special like below:
கிழமை
Function
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;
}
You may need to use Tamil charset. Check out the following link:
http://www.iam.uni-bonn.de/~alt/html/unicode_25.html
Use header like this:
$headers = array("Content-Type: application/x-www-form-urlencoded; charset: UTF-8");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HEADER, 1);