Author |
Post |
|
#1 Tue Oct 13, 2009 07:50, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
|
Operating system name and version: Linux bubba 2.6.26.5 #3 Thu Aug 6 14:46:56 CEST 2009 ppc GNU/Linux Version of smsd: 3.1.5. Smsd installed from: sources Name and model of a modem / phone: Nokia 30 Interface: serial to USB adapter
Hi! I would like to set up smsd to correctly work with accentuated characters:
My setup now: locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=
config: decode_unicode_text = yes incoming_utf8 = yes cs_convert = yes
I did tried first two with different combinations, but without success - accentuated characters are wrong.
If incoming message are only with Latin characters and both decode_unicode_text and incoming_utf8 is set to "no", then Alphabet: ISO. If incoming message are with accentuated characters, the Alphabet: UCS2
What I am missing? Thanks in advance!
|
|
#2 Tue Oct 13, 2009 10:05, 186 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Current version of smsd does not convert Unicode messages properly when a message is written using your language. Internal conversion is limited to ISO character set only. Next version will fix this issue. You can use incoming_utf8, it should work because it's applied only for messages which are delivered using the GSM character set. Use the eventhandler to convert incoming messages. 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 (chmod 755 /usr/local/bin/smsd_eventhandler.sh) and restart the daemon using the sms3 script. Do you have this problem with outgoing messages too? For curiosity, can you show what characters were incorrect?
|
|
#3 Tue Oct 13, 2009 10:45, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
Yes, the same problem is for outgoing SMS.
The accentuated characters you can see in this page: http://www.daily-tangents.com/Notes/LV-Fonts.shtml
Look for table "HTML CODING FOR LATVIAN LETTERS"
I will try that event handler latter and report on results.
|
|
#4 Tue Oct 13, 2009 11:13, 186 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Thanks for the link. You will need Unicode encoding for those characters and it means that single SMS can contain 70 characters only. For easier usage with smsd below 3.2, use the checkhandler to convert outgoing messages: checkhandler = /usr/local/bin/smsd_checkhandler.sh#!/bin/bash
if sed -e '/^$/ q' < "$1" | grep "^Alphabet: UTF-8" > /dev/null; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < "$1" | sed -e 's/Alphabet: UTF-8/Alphabet: UCS2/g' > $TMPFILE sed -e '1,/^$/ d' < "$1" | iconv -f UTF-8 -t UNICODEBIG >> $TMPFILE mv $TMPFILE "$1" fi 'bash' Syntax Highlight powered by GeSHi When you create a message which contains accentuated characters, use the header Alphabet: UTF-8 and write a message body using that encoding. For example: To: 358401234567 Alphabet: UTF-8
Here is: Amacron Ā, Emacron Ē, Imacron Ī, ...
The checkhandler will convert a message body to UCS2 and replaces the header. If you want to send SMS with english text and 160 characters in single part, just leave the Alphabet header out.
|
|
#5 Tue Oct 13, 2009 11:44, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
What about concatenation an splitting? Will that do not allow more then 70 chars per message?
|
|
#6 Tue Oct 13, 2009 12:11, 186 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
With "single SMS" I actually meant single part, sorry.
On SMS can consist of maximum 255 parts, in theory. Some phones do not support this large count of parts. One part can contain 160 characters with GSM alphabet, or 70 characters with Unicode. If a text is longer than this limit, there will be more than one parts and information of concatenation is included in each part. This reduces number of useable characters to 153 (GSM) or 67 (Unicode) in each part. Message sent using Unicode can then have 17085 characters maximum.
|
|
#7 Tue Oct 13, 2009 20:03, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
With incoming messages it just worked, but for out coming no: I am getting Fail reason: Invalid alphabet This is my eventhandler script:
|
|
#8 Tue Oct 13, 2009 20:09, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
I also modified sendsms for ease of work:
Added alphabet setting After line $echo "To: $destination" >> $TMPFILE I inserted: $echo "Alphabet: UTF-8" >> $TMPFILE
But as it did not work I took that line away.
|
|
#9 Tue Oct 13, 2009 20:51, 186 months ago.
|
Member
Registered: Oct 2009
Location: Latvia
Topic owner
|
Ups - sorry! For outgoing I needed checkhandler not eventhandler!
It also just works. :-) Thank you for you support.
|