日语文字在手机中不可见 [英] Japanese text not visible in mobile

查看:125
本文介绍了日语文字在手机中不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在发送带有日语字符的短信.

I am sending text message having Japanese characters.

这是我的留言

日语

このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください

英语

use this OTP to login to Quik Drive. Please don't share this OTP to anyone

这就是我要得到的

> 这是我在手机上得到的东西

这是我的nodejs代码

Here is my nodejs code

class ClickatellService {
  constructor() {
    this.sendSms('+mobileNumber', 'このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください')
  }

  sendSms(to, message) {
    return new Promise((resolve, reject) => {
      request.get(
        `https://api.clickatell.com/http/sendmsg?user=XXX&password=XXX&api_id=XXX&to=${to}&text=${encodeURI(
          message
        )}`,
        (error, response, body) => {
          if (error) {
            return resolve(error)
          } else {
            return resolve(response)
          }
        }
      )
    })
  }
}

我能做些什么来获得简单日语的消息.

What I can do to be getting the message in simple japanese language.

任何帮助将不胜感激!

推荐答案

您需要使用Unicode通过SMS发送非GSM字符,然后还要设置unicode参数.

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

这是一个PHP示例:

$converted = iconv(
    "UTF-8", 
    "UCS-2BE", 
    "このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください"
);

$sms_data = urlencode(bin2hex($converted));

http://api.clickatell.com/....text=$sms_data&unicode=1

注意:Unicode消息通常比非unicode消息短,因此请小心,因为您可能要为多条消息付费,详细信息请参见:

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/开发人员/api-docs/concatenation-advanced-message-send/

摘要:

70个(16位)字符 发送级联邮件时,每个邮件部分使用67个(16位)字符

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

这篇关于日语文字在手机中不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆