Encoding of SMS Simple Text for Long SMS

Encoding of SMS Simple Text for Long SMS SearchSearch
Author Message
William
Posted on Wednesday, April 02, 2003 - 10:37 am:   

Dear Sir,

For the text message with length less than or equal to 160, I can receive the content correctly as ASCII encoding scheme from TCP/IP connection. ( I write a Java program to communicate with NowSMS and print out the content of the received data right after the read function of inputstream. ) But for text message more than or equal to 161, the content is completely different. I would like to know to obtain the correct content of the text message??

Thanks
Bryce Norwood - NowSMS Support (Bryce)
Posted on Monday, April 07, 2003 - 10:34 pm:   

Hi William,

When a simple text message goes out via SMS, it uses a 7-bit encoding.

GSM SMS has a limit of 140 bytes. When 7-bit encoding is used, 8 characters can be packed into every 7 bytes, and that is where the 160 character limit in SMS comes from.

If a message contains characters outside of the GSM 7-bit character set (this character set defined in the ETSI GSM 03.38 specification), then an SMS message must be encoded in 16-bit Unicode format, and you have a limit of only 70 characters per SMS message.

So when a simple text SMS message is longer than 160 characters, a technique called concatenation is used to send longer messages. Concatenation of SMS messages is defined in the ETSI GSM 03.40 specification.

A single logical message is sent as multiple SMS messages with a 6 byte header followed by up to 153 characters of text per message.

If you wanted to decode this data, you'd have to refer to these two specifications.

Note that when NowSMS interfaces with a GSM modem, it performs this 7-bit encoding on even regular short SMS text messages when sending/receiving over the GSM modem interface.

Maybe there is another way to achieve what you're trying to achieve?

When NowSMS reads in a long message, it automatically performs the necessary decoding and reassembles the message before handing it off to an application. So I'm guessing that you must need to do something more complicated?

Let me know if I can help or answer any more questions.

-bn