Expand description

Utilities for dealing with the (annoying) GSM 7-bit encoding (GSM 03.38), and decoding/encoding message data.

“The annoying GSM 7-bit encoding” is otherwise known as GSM 03.38, and that Wikipedia article is pretty informative.

NB: SMS messages that are longer than the per-message character limit are sent & received as concatenated SMS messages. The various functions in this module will attempt to warn you about this.

Modules

  • Utilities for dealing with User Data Headers (used for concatenated SMS, among other things) inside messages.

Structs

  • A decoded text mesasge, with optional user data header.
  • The ‘data’ portion of an SMS message - i.e. the text, for a simple message.

Functions

  • Decode a GSM 7-bit-encoded buffer into a string.
  • Tries to encode a character into the given destination buffer, returning true if the character was successfully encoded, and false if the character cannot be represented in the GSM 7-bit encoding.
  • Tries to encode a string as GSM 7-bit, returning a buffer of unpacked septets iff all of the data in input was representable in the 7-bit encoding.