Jump to content

Passing UNICODE chars using cURL


malaiselvan

Recommended Posts

Hi,

 

I am writing a PHP program to send SMS using HTTP API gateway.

I use cURL to launch the URL.

 

I am getting problems when I send UNICODE chars in the message.  I am getting simply square boxes instead of UNICODE chars.  When I launch the same URL directly in a browser it works well.

 

Following is the code snippet currently I have.

 

    $message = "unicode chars here";
    $launch_api = "http://xxxsss.com/send.php?message=".$message."&sender=aaa&to=xxxx&type=2&username=bbbb&password=cccc";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_URL,$launch_api);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $contents = curl_exec ($ch);

 

    curl_close ($ch);

 

Could some one please help me what I am missing?

Link to comment
https://forums.phpfreaks.com/topic/222403-passing-unicode-chars-using-curl/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.