One of my PHP sms application I am trying to send unicode character but it will gives some unwanted character in my sms. But when I am trying send through direct url it will gives me perfect result. I am totally confused how I will implement in my application.
my application code generate below url
function sendMsg($message,$contactNo)
{
$ch = curl_init();
$rno = urlencode(utf8_encode($contactNo));
$txt = urlencode(utf8_encode($message));
$txt=preg_replace('/%0A/',"", $txt);
curl_setopt($ch,CURLOPT_URL,"http://sms.*****.com/reseller/sendsms.jsp?user=****&password=****&mobiles=******&sms=$txt&senderid=******&unicode=1");
$buffer = curl_exec($ch);
curl_close($ch);
if($buffer==FALSE){
return FALSE;
}else{
return TRUE;
}
}
I am getting value of txt = %E5%BC%95%E3%81%8D%E5%89%B2%E3%82%8A
Direct URL
http://sms.*****.com/reseller/sendsms.jsp?user=****&password=****&mobiles=******&sms=ಯುನಿಕೋಡ್&senderid=******&unicode=1