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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.