Code Repo    |     RSS
MD's Technical Sharing



Monday, November 3, 2008

SMS Character Counting

As far as character set is concerned, there are 2 types of SMS.

1) ASCII (7 bits) SMS
2) Unicode SMS - If 1 or more char is a non-ASCII, then it is a Unicode SMS. Read what is Unicode.

SMS length for ASCII SMS

Single SMS: 160
Multiple SMS: 153n , where n is number of SMS and n>1

Example:

1st message: 160 characters
2nd message: 160 + 146 characters
3rd message: 160 + 146 + 153 characters
...

Pitfalls: This is important and it applies to ASCII SMS only. Some characters are regarded as 2 characters, as they actually need more than 7 bits to represent. ASCII SMS table shows the Hex (leftmost column) used to represent each character. You will find that there are 10 characters (form feed, ^, [, ], ...) requires 2 Hex to represent. Hence, these 10 characters need special attention.

SMS length for Unicode SMS

Single SMS: 70
Multiple SMS: 67n

Example:

1st message: 70
2nd message: 70 + 64
3rd message: 70 + 64 + 67

References:

1. http://www.joelonsoftware.com/articles/Unicode.html
2. http://www.dreamfabric.com/sms/default_alphabet.html
3. http://www.dreamfabric.com/sms/default_alphabet.html

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.