Japanese text not visible in mobile

后端 未结 2 1504
慢半拍i
慢半拍i 2021-01-27 18:27

I am sending text message having Japanese characters.

Here is my message

In japanese

このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください
2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-27 18:55

    You need to use Unicode to send non GSM characters via SMS and then also set the unicode parameter.

    Here is a PHP example:

    $converted = iconv(
        "UTF-8", 
        "UCS-2BE", 
        "このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください"
    );
    
    $sms_data = urlencode(bin2hex($converted));
    
    http://api.clickatell.com/....text=$sms_data&unicode=1
    

    NOTE: Unicode messages are generally shorter than non-unicode messages, so be careful as you may pay for more than one message, detailed info over here:

    https://archive.clickatell.com/developers/api-docs/concatenation-advanced-message-send/

    Snippet:

    70 (16-bit) characters allowed in a single SMS message part 67 (16-bit) characters used per message part when sending concatenated messages

提交回复
热议问题