Skip to content

GSM-7 encoding is actually GSM-8? #123

@davidshepherd7

Description

@davidshepherd7

Hi,

I think smpplib's GSM-7 encoding is only encoding to GSM-8, but not doing the byte-packing step to convert to GSM-7.

Here's an example:

For an SMS containing "This is a test SMS from wave: é à É ô" we get this PDU in the logs: 000000550000000400000000000004b40005005741564500010032323530323132313630360000000000000100000025546869732069732061207465737420534d532066726f6d20776176653a2005207f201f206f

Taking the trailing bytes of that and converting back from hex we get:

In [5]: binascii.unhexlify("546869732069732061207465737420534d532066726f6d20776176653a2005207f201f206f")
Out[5]: b'This is a test SMS from wave: \x05 \x7f \x1f o'

Which is mostly ascii, and so can't be a 7-bit encoding. I also can't find any code in smpplib which looks like it does the byte-packing.

Maybe I'm using smpplib incorrectly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions