Kyriacos Sakkas wrote:
Hi All,
I need help with the following. I have a CIMD connection with an
operator, and need a way of receiving non default ASCII characters
(Greek). CIMD "encodes" them by sending for example _gp for the Greek
pi Π character.
When I submit this to my application I get question marks (?) in
place of all the Greek characters, both in the %a and %b fields.
This is not a problem of CIMD, rather use the attached patch (against
kannel-1.4.0/gwlib/charset.c) which will pass through greek characters
instead of substituting them with ``?''.
You should know that this applies to GSM-7bit alphabet which
provides support only for capital greek letters that differ optically
from any other latin alphabet letter as follows:
delta = 0x10;
fi = 0x12;
gamma = 0x13;
lambda = 0x14;
omega = 0x15;
pi = 0x16;
psi = 0x17;
sigma = 0x18; /* be mindfull of teliko ``s'' */
theta = 0x19;
ksi = 0x1A;
all other letters are their capitalized latin equivalent (e.g. latin
capital ``P'' is used in place of greek capital ``R'').
Of course sending requires the same transliteration. To send greek
``KALHMERA'', you'd need to set the text parameter to sendsms as
follows: ``text=KA%14HMEPA''
The rest is self-explanatory I believe.
Regards,
Thanos Chatziathanassiou
Here are some details:
running kannel-cvs (got source 2 days ago so I guess 20060704) but
had same problem with kannel 1.4 debian packeges
[kannel.conf]
group = smsc
smsc = cimd2
smsc-id = thissmsc
allowed-prefix = xxxxxxxx
throughput = 30
host = xxx.xxx.xxx.xxx
port = xxxx
smsc-username = user
smsc-password = pass
my-number = 1111
denied-smsc-id = other smscs on same kannel server
keepalive = 5
group = sms-service
keyword = default
get-url =
"http://server/path/script_in.php?provider=C&sender=%p&text=%a&recipient=%P&time=%t&bin=%b"
accept-x-kannel-headers = true
max-messages = 3
concatenation = true
accepted-smsc = thissmsc
[kannel.log]
2006-07-06 10:40:15 [2883] [24] DEBUG: CIMD2[thissmsc]: received:
<20:004 021:xxxx000001 023:xxxxxxxxxxxx 060:060706104014 033:_ggIA
THN O_glOK_glHP_go_gsH TH_gs _gpAPA_gg_ggE_glIA_gs _gsA_gs KAI _ggIA
NA _glABETE TO _gpPOION _gpOY _gpAPA_gg_ggEI_glATE _gpAPAKA_gl_go
_gsTEI_glTE 1 052:0 030:0 028:30971300000 026:202010300883818
069:309710001886>
2006-07-06 10:40:15 [2883] [24] DEBUG: CIMD2[thissmsc]: sending
<70:004 40>
2006-07-06 10:40:15 [2883] [24] DEBUG: CIMD2[thissmsc]: new message
received
[Aplication Log]
Jul 06 11:01:21 VQC [info] incoming
Jul 06 11:01:21 VQC [info] Sender: xxxxxxxxxxxx Provider:C
Jul 06 11:01:21 VQC [info] text: ?IA THN O?OK?HP??H TH? ?APA??E?IA?
?A? KAI ?IA NA ?ABETE TO ?POION ?OY ?APA??EI?ATE ?APAKA?? ?TEI?TE 1
Jul 06 11:01:21 VQC [info] bin: ?IA THN O?OK?HP??H TH? ?APA??E?IA?
?A? KAI ?IA NA ?ABETE TO ?POION ?OY ?APA??EI?ATE ?APAKA?? ?TEI?TE 1
Jul 06 11:01:21 VQC [info] recipient: xxxx000001
Jul 06 11:01:21 VQC [info] time: 2006-07-06 08:01:20
Jul 06 11:01:21 VQC [info] incoming enc: ASCII
=======================================
Any help will be greatly appreciated.
------------------------------------------------------------------------
--- charset.c.orig Thu Jan 22 16:08:24 2004
+++ charset.c Mon Feb 27 12:23:49 2006
@@ -76,11 +76,15 @@
* The escape character, at position 27, is mapped to a space,
* though normally the function that indexes into this table will
* treat it specially. */
+
+/* patched for greek chars already present in GSM 7bit
+ (chars 0x10,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a) */
+
static const unsigned char gsm_to_latin1[128] = {
'@', 0xa3, '$', 0xa5, 0xe8, 0xe9, 0xf9, 0xec, /* 0 - 7 */
0xf2, 0xc7, 10, 0xd8, 0xf8, 13, 0xc5, 0xe5, /* 8 - 15 */
- '?', '_', '?', '?', '?', '?', '?', '?', /* 16 - 23 */
- '?', '?', '?', ' ', 0xc6, 0xe6, 0xdf, 0xc9, /* 24 - 31 */
+ 0x10, '_', 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 16 - 23 */
+ 0x18, 0x19, 0x1a, ' ', 0xc6, 0xe6, 0xdf, 0xc9, /* 24 - 31 */
' ', '!', '"', '#', 0xa4, '%', '&', '\'', /* 32 - 39 */
'(', ')', '*', '+', ',', '-', '.', '/', /* 40 - 47 */
'0', '1', '2', '3', '4', '5', '6', '7', /* 48 - 55 */