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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • amar elzaman
    New Member
    • Aug 2009
    • 4

    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","PC CP437","PCDN"," IRA","HEX","885 9-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","H EX","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.GetEnc oding("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="phoneN O"
    >message الرساله+ct rlZ



    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..
  • SaeedBamatraf
    New Member
    • Dec 2009
    • 1

    #2
    Solution to your proble

    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 "06450631062D06 280627"

    try this code to convert text to unicode:

    UnicodeEncoding uni = new UnicodeEncoding ();
    byte[] encodedBytes = uni.GetBytes(tx tMessage.Text);
    string text = "";
    for (int i = 0; i < encodedBytes.Le ngth; 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

    Comment

    • markmcgookin
      Recognized Expert Contributor
      • Dec 2006
      • 648

      #3
      Saeed welcome to Bytes, thanks for this great reply! Hope to see more useful posts from you!

      Comment

      • Omar Alqurashy
        New Member
        • Oct 2010
        • 1

        #4
        thanks Saeed,
        but when I write this command

        AT+CSMP=17,167, 0,8

        get ERROR?
        Attached Files

        Comment

        Working...