我正在发送包含日语字符的短信。
这是我的留言
日语
このOTPを使用してQuikドライブにログインします。 このOTPを誰とも共有しないでください
英文
use this OTP to login to Quik Drive. Please don't share this OTP to anyone
这是我得到的
Here what I am getting on my mobile phone
这是我的nodejs代码
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)
}
}
)
})
}
}
我可以做什么来以简单的日语接收消息。
任何帮助将不胜感激!!!
最佳答案
您可能需要在发送之前将字符集设置为 UTF-8。 我不知道您在代码中使用的实际字符集是什么,但请确保它是 UTF-8。
如果您已经使用 UTF-8,请确保您使用的实际字体能够处理日语字母。
有关如何处理日语字母的更多说明,也许您应该检查以下内容:
关于javascript - 日语文字在手机中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58952470/