Author |
Post |
|
#1 Sun Oct 25, 2015 21:19, 110 months ago.
|
Member
Registered: Oct 2015
Location: Brno, Czech Republic
|
Hello, I am using the phone above to send out sms text "ČŠĎŮčeština", received log smsd.log:
GSM2: <- +CMGR: 0,,43 0791246080006528240C9124707362023800085101521273614018010C0160010E016E011A010D0065016100740069006E0061 OK GSM2: SMS received, From: 420xxxxxx GSM2: Wrote an incoming message file: /var/spool/sms/incoming/GSM2.eWX423
view on the file /var/spool/sms/incoming/GSM2.eWX423 :
Subject: GSM2 Modem: GSM2 IMSI: 230030090959675 Report: yes Alphabet: UCS2 Length: 12 PDU: 0791246080006528240C9124707362023800085101522260024018010C0160010E016E011A010D0065016100740069006E0061
...`...n... .e.a.t.i.n.a
Why PDU decoder text is too poor to convert the text into shape? Has a problem with Alphabet: UCS2 (16) bit?
thanks
|
|
#2 Mon Oct 26, 2015 20:49, 110 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Message body in the file is UCS2 coded. You can use the eventhandler to convert this kind of incoming messages to UTF-8. In global part of smsd.conf, define: eventhandler = /usr/local/bin/smsd_eventhandler.shCreate this file with a following content: #!/bin/bash
if [ "$1" == "RECEIVED" ]; then
if sed -e '/^$/ q' < "$2" | grep "^Alphabet: UCS2" > /dev/null; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < "$2" | sed -e 's/Alphabet: UCS2/Alphabet: UTF-8/g' > $TMPFILE sed -e '1,/^$/ d' < "$2" | iconv -f UNICODEBIG -t UTF-8 >> $TMPFILE mv $TMPFILE "$2" fi
fi 'bash' Syntax Highlight powered by GeSHi Make the file executable for smsd and restart the daemon.
|
|
#3 Mon Oct 22, 2018 07:50, 74 months ago.
|
Member
Registered: Oct 2018
Location: Germany
|
I've changed the code to the following: This seems to work better with unicode and emojis. With UNICODEBIG incoming messages has been cut at emojis. smstools version 3.1.21
|