469,300 Members | 2,326 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,300 developers. It's quick & easy.

how to send unicoded sms through pc and gsm(urgent)

i'm working on a project to send sms through pc and gsm modem(mobile)
and every thing is ok, i succeded to send but english sms only,
when i tried to send arabic the message sent with errors in encoding the arabic characters.
my mobile is nokia n73, it supports these character sets ofencoding
UCS2","GSM","PCCP437","PCDN","IRA","HEX","8859-1

this is sample code i entered in the hyper terminal,
and surely i tested in c# but also failed



AT+CSCS=?
+CSCS:("UCS2","GSM","PCCP437","PCDN","IRA","HEX"," 8859-1")
OK

At+CSCS?
+CSCS:"PCCP347"
OK

AND I knew that only(ucs-2, gsm, pccp437) support arabic language
but c# doesn't support anyone of them
i tried in c# getEncoding to use(utf-8 or ("utf-16 as it is similar somehow to the ucs2")
also, iso-8859-9 and 8859-6 and windows-1256)
like
[[[[ port.Encoding = Encoding.GetEncoding("utf-8"); ]]]]]

but useless

also
i tried to use this code in hyper terminal and in c# code(with the past character sets like:
AT+cscs="ucs2"
AT+CMGS="phoneNO"
>message الرساله+ctrlZ



also the message recieve with encoding errors

i don't know what i should do, but now i'm searching to add ucs-2 character set page to visual c#, however it failed even to send from the hyper terminal.

hint:: i tried to send from demo program called (headwind sms)and it sent succefully the arabic message that means no problems in my mobile.

could anyone help me,please??, or tell me about adding encoding face.

and sorry for writing so much..
Aug 30 '09 #1
3 14244
Same problem face me too today
and I solved it like this :
first if your mobile support Hex mode
(you can know by writting : AT+CSCS=? )

then make the mode Hex as follows:
AT+CSCS="HEX"
then execute this command :
AT+CSMP=17,167,0,8

now you are ready to send the arabic message but after u make some encoding
for example "مرحبا" will become "06450631062D06280627"

try this code to convert text to unicode:

UnicodeEncoding uni = new UnicodeEncoding();
byte[] encodedBytes = uni.GetBytes(txtMessage.Text);
string text = "";
for (int i = 0; i < encodedBytes.Length; i += 2)
{
text += string.Format("{0:X2}", encodedBytes[i + 1]) + string.Format("{0:X2}", encodedBytes[i]);
}
now text contain the message which is ready to send

I hope it will solve ur problem

Saeed
Yemen
Dec 7 '09 #2
markmcgookin
648 Expert 512MB
Saeed welcome to Bytes, thanks for this great reply! Hope to see more useful posts from you!
Dec 14 '09 #3
thanks Saeed,
but when I write this command

AT+CSMP=17,167,0,8

get ERROR?
Attached Images
File Type: jpg unti88tled.jpg (23.1 KB, 1203 views)
Oct 1 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Ray Paseur | last post: by
16 posts views Thread by | last post: by
3 posts views Thread by N. Spiker | last post: by
2 posts views Thread by pradeepm | last post: by
23 posts views Thread by jagmonni | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.