Jump to content

PHP is adding ? to unicode values


Mr.n

Recommended Posts

Dear all,

 

We are having a problem with php application. When we send unicode values the ? is automatically added to the text.

We tried to modify the php.ini directive: mbstring.substitute_character = "none" but nothing happened. Anyone can help please?

 

Thank you,

Link to comment
Share on other sites

Actually i have an sms application that creates automatically a url, here is the text making the problem: text=r%C3%A9r%C3%A9r%C3%A9

 

i did a debugging and now i am sure that php is adding something because the text does not have any added code!!

 

here is the code of the application:

 

    $URL .= "&text=".urlencode($sms_msg);
    $URL .= "&dlr-mask=31&dlr-url=".urlencode($kannel_param['playsms_web']."/plugin/gateway/kannel/dlr.php?type=%d&slid=$smslog_id&uid=$uid");
    $URL .= "&mclass=".$msg_type;
        }
        else
        {
    $URL = "/cgi-bin/sendsms?username=".urlencode($kannel_param['username'])."&password=".urlencode($kannel_param['password']);
    $URL .= "&from=".urlencode($sms_from_sender)."&to=".urlencode($sms_to)."&smsc=routeleb";
    if ($unicode == 1) {
      $URL .= "&charset=utf-8&coding=2";
    //  if (strlen($sms_msg) >= 70) $sms_msg = substr($sms_msg,0,69);
    } else if (strlen($sms_msg) >= 160) {
    // $sms_msg = substr($msg_msg,0,159);
    }
   $URL .= "&text=".urlencode($sms_msg);
   $URL .= "&dlr-mask=31&dlr-url=".urlencode($kannel_param['playsms_web']."/plugin/gateway/kannel/dlr.php?type=%d&slid=$smslog_id&uid=$uid");
    $URL .= "&mclass=".$msg_type;
        }
    $connection = fsockopen($kannel_param['bearerbox_host'],$kannel_param['sendsms_port'],&$error_number,&$error_description,60);
    if($connection)
    {
        socket_set_blocking($connection, false);
        fputs($connection, "GET $URL HTTP/1.0\r\n\r\n");

Link to comment
Share on other sites

OKay i tried some arabic characters and discovered a new thing!! arabic chars appears as *? and latin chars appears like r? . here is an example !!!

thats what i write: réunionréunion تست

and it appears in unicode format as:  ?r?é?u?n?i?o?n?r?é?u?n?i?o?n ?*?3?*?

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.