Encoding and Concatenation

    Overview

    This guide will help you understand the types of SMS character encoding used at Plivo and how messages are handled when the character limit increases beyond a certain limit. When sending SMS using Plivo, we will encode messages based on the characters used in the message text.

    Message units

    SMS messages sent using Plivo are charged based on the message units each message contains. Therefore, it’s helpful to understand how message units work to estimate your SMS charges. When a message text is too long, your message will be split into multiple message units. Each unit will be 140bytes. The way your message is split will depend on the type of character encoding applied to your message text.

    Encoding types

    Plivo supports two types of character encoding, namely, GSM(GSM03.38) and Unicode(UCS-2).

    GSM03.38

    • This type of encoding applies when characters used in the message text are from within the standard GSM-7 and extended character sets.

    • GSM-7 characters are seven-bit characters. The calculation of the characters for one SMS unit is as follows:

      • 1 unit of SMS: 140bytes,
      • 1 byte: 8bits,
      • (140 bytes*8 bits)/7 bits = 160characters.

    UCS-2

    • When the characters are not from the GSM-7 and extended character sets, Plivo will automatically convert to UCS-2 character encoding for the entire message.

    • UCS-2 characters are 16-bit characters. Therefore, the calculation of the characters for one SMS unit will be:

      • 1 unit of SMS: 140bytes,
      • 1 byte: 8bits,
      • (140 bytes*8 bits)/16 bits = 70characters.

    Concatenation

    When you send a long message that contains more than one unit of SMS, the message will be split into multiple units. Message concatenation is the concept of assembling the message with multiple units into a single message at the receiving end. To accomplish this, Plivo segments the long message into multiple units. The segmentation information is added to the User Data Header(UDH) of the payload for each unit of the message.

    concatenated_sms

    Note: multi-unit messages are automatically stitched back together and delivered as a single message in countries where mobile networks support long message concatenation.

    Character limits

    The character limit of the whole message is based on the type of encoding applied for the message text.

    GSM

    Messages containing only GSM03.38 7-bit characters have a maximum limit of 1600 characters. Messages longer than 160 characters are split into multiple message units, each unit consisting of 153 characters.

    • 1 unit of SMS: 140 bytes,
    • User Data Header: 6 bytes,
    • 140bytes - 6bytes: 134 bytes == 1072 bits.
    • GSM characters: 7 bits,
    • 1072/7: 153 characters.

    Unicode

    Messages containing one or more UCS-2 16-bit unicode characters have a maximum limit of 737 characters. Messages longer than 70 characters are split into multiple message units, each unit consisting of 67 characters.

    • 1 unit of SMS: 140 bytes,
    • User Data Header: 6 bytes,
    • 140bytes - 6bytes: 134 bytes == 1072 bits.
    • Unicode characters: 16 bits,
    • 1072/16: 67 characters.
    Note: two-way SMS-enabled virtual numbers provided by Plivo support SMS concatenation by default. This means when the SMS message sent to your virtual number is more than one unit, then it will be automatically concatenated as a single message.

    Check your character limit and message units

    Insert your SMS Content

    Units 0
    Characters 0
    Encoding Type -