playSMS Forum

[solved] No Alphabet: field inside outgoing SMS -> unicode problems

On my second instalation of PlaySMS ( Debian 10 AMD64 Intel arch. ) I have issue on unicode outgoing SMS’s. Unicode polish characters like ‘ąęń’ are not sent by smstools properly. Inside processed SMS from sent directory You may find:

From: SMSGATE
To: +48XXXXXXXXX
Report: yes
Modem: GSM1
Sent: 21-02-04 22:53:47
Sending_time: 4
Message_id: 225
IMSI: 260060012287775
IMEI: 861145017338303
NOTICE: Cannot convert 1. character (C484)Ą to GSM.
NOTICE: Cannot convert 2. character (C498)Ę to GSM.
NOTICE: Cannot convert 3. character (C59A)Ś to GSM.
NOTICE: Cannot convert 4. character (C5BB)Ż to GSM.
NOTICE: Cannot convert 5. character (C5B9)Ź to GSM.
NOTICE: Cannot convert 6. character (C486)Ć to GSM.
NOTICE: Cannot convert 7. character (C583)Ń to GSM.
NOTICE: Cannot convert 8. character (C581)Ł to GSM.

ĄĘŚŻŹĆŃŁÓ ola la @admin

and message is not sent properly.

When I add a line:
Alphabet: UTF-8
and resend the message the info differs:

From: SMSGATE
To: +48XXXXXXXXX
Report: yes
Alphabet: UTF-8
Modem: GSM1
Sent: 21-02-04 22:55:17
Sending_time: 3
Message_id: 226
IMSI: 260060012287775
IMEI: 861145017338303
NOTICE: Cannot convert 1. character (C484)Ą to GSM.
NOTICE: Cannot convert 2. character (C498)Ę to GSM.
NOTICE: Cannot convert 3. character (C59A)Ś to GSM.
NOTICE: Cannot convert 4. character (C5BB)Ż to GSM.
NOTICE: Cannot convert 5. character (C5B9)Ź to GSM.
NOTICE: Cannot convert 6. character (C486)Ć to GSM.
NOTICE: Cannot convert 7. character (C583)Ń to GSM.
NOTICE: Cannot convert 8. character (C581)Ł to GSM.
NOTICE: 8 characters outside the GSM alphabet, converting to UCS2

ĄĘŚŻŹĆŃŁÓ ola la @admin

and message is sent properly and on the phone is with proper unicode character.

What is wrong?
Why PlaySMS does not add Alphabet: UTF-8 line?

As I said - this is 2-nd instalation. First was on Rasbian Debian 10 and sending SMS with unicode with PlaySMS worked fine from the begining.

Can You help me?

I think “Alphabet: UTF-8” came from the external scripts, that you used and worked properly on previous post, because on playSMS the smstools gateway plugin never wrote it

anton

No… I found some post in internet and added it manually ( moved to outgoing dir ) and it helped.
I use no scripts.

So what to do?
Also SMS sent from Compose message menu that are with unicode - are sent in wrong form without chracters… ?

So you only need to add “Alphabet: UTF-8” and it will work ?

If so, you can try to custom the plugin, modif your plugin/gateway/smstools/fn.php at line 252.

This is the original:

	if ($unicode) {
		if (function_exists('mb_convert_encoding')) {
			$the_msg .= "Alphabet: UCS\n";
			$sms_msg = mb_convert_encoding($sms_msg, 'UCS-2BE', 'auto');
		}
		// $sms_msg = str2hex($sms_msg);
	}

and after modification to add “Alphabet: UTG-8”

	if ($unicode) {
		if (function_exists('mb_convert_encoding')) {
			$the_msg .= "Alphabet: UCS\n";
			$sms_msg = mb_convert_encoding($sms_msg, 'UCS-2BE', 'auto');
		}
		// $sms_msg = str2hex($sms_msg);
	} else {
		$the_msg .= "Alphabet: UTF-8\n";
	}

Save the file, restart playSMS daemon and test again

Oh, make sure you install php-mbstring

anton

Probably the fault was mine. There were no php-mbstring package.
After adding it to a system all enconing looks perfect ( on the phone ) and header of sms looks like:

From: SMSGATE
To: +48XXXXXXXXX
Report: yes
Alphabet: UCS
Modem: GSM1
Sent: 21-02-05 15:36:21
Sending_time: 4
Message_id: 233
IMSI: 26XXXXXXXXXXXX
IMEI: 86XXXXXXXXXXX

and the Alphabet: field appeared properly WITHOUT the modification You suggested.

Thank You!

1 Like

I wonder if you could help me test that modification.

Alphabet: UCS to Alphabet: UCS2, and Alphabet: UTF-8 will be there for non-unicode SMS
the position of Alphabet: UCS2 also before if function exists mb_convert_encoding