Author |
Post |
|
#1 Mon Sep 07, 2009 02:46, 178 months ago.
|
Member
Registered: Sep 2009
Location: China
|
hi, i have create a sms file with Alphabet has the value "UCS2",and i add some chinese characters as sms body.I can send it successfully,but when i check it in Mobile ,it is not my except.It looks like i didn't choose the right file format for the sms file .did i miss anythig? thank this is my smsd.conf: « Last edit by hankchan on Mon Sep 07, 2009 02:48, 178 months ago. »
|
|
#2 Mon Sep 07, 2009 02:54, 178 months ago.
|
Member
Registered: Sep 2009
Location: China
Topic owner
|
It is strange that if i send this sms file to myself , i can see the correct chinese characters in the incoming folder.but if i check the sms in my mobile inbox , it just display messy code.can anyone give me some suggesting?
|
|
#3 Mon Sep 07, 2009 03:07, 178 months ago.
|
Member
Registered: Sep 2009
Location: China
Topic owner
|
this is the test sms file :
|
|
#4 Mon Sep 07, 2009 10:39, 178 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Your message text is created using UTF-8 and it should be converted to the Unicode (Big Endian). Current version of smsd does not do this automatically. Define a checkhandler script with the following content: #!/bin/bash
if sed -e '/^$/ q' < "$1" | grep "^Alphabet: UCS2" > /dev/null; then TMPFILE=`mktemp /tmp/smsd_XXXXXX` sed -e '/^$/ q' < $1 > $TMPFILE sed -e '1,/^$/ d' < $1 | iconv -f UTF-8 -t UNICODEBIG >> $TMPFILE mv $TMPFILE $1 fi 'bash' Syntax Highlight powered by GeSHi
|
|
#5 Mon Sep 07, 2009 10:53, 178 months ago.
|
Member
Registered: Sep 2009
Location: China
Topic owner
|
keke,thank you very much . i have solve the problem ,and i will try your script later . i did it as follow:
|
|
#6 Mon Sep 07, 2009 11:29, 178 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
If you are receiving messages written with Chinese alphabet, you might try this script as an eventhandler: #!/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
|