SMS with Chinese characters

Hello,

I have to support sms with Chinese characters like 作?槭澜缟献罟爬系娜?大文字系
It should be in UCS-2 codding .
How can I support this format ?
My code on /kannel/fn.php
// Automatically setting the unicode flag if necessary
//if (!$unicode) $unicode = core_detect_unicode($sms_msg);

// auto detect unicode
if (!$unicode) $unicode = core_detect_unicode($sms_msg. $sms_footer);

if ($unicode) {
	if (function_exists('mb_convert_encoding')) {
		$sms_msg = mb_convert_encoding($sms_msg, "UCS-2BE", "auto");
		$URL .= "&charset=UTF-16BE";
	}
	$URL .= "&coding=2";
}

$URL .= "&account=" . $account;
$URL .= "&text=" . urlencode($sms_msg);

On smsbox.log I see
2021-07-15 16:19:39 [32594] [3] INFO: sendsms sender:china-user:CMIAlpha (127.0.0.1) to:<85296532158> msg:<O>
2021-07-15 16:19:39 [32594] [3] ERROR: Failed to convert msgdata from charset UTF-16BE to UTF-16BE, will leave as is.
2021-07-15 16:19:39 [32594] [3] DEBUG: Status: 400 Answer: <Charset or body misformed, rejected>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.