A C-Octet string, is a series of ASCII characters terminated with the NULL character.
see; section 3.1 of SMPP spec
Thus we need to encode any field that is a C-Octet strings as ascii and also terminate them with NULL char(chr(0).encode())
eg, system_id.encode("ascii") + chr(0).encode()
Also they should be decoded as such; message_id.decode('ascii')
Thank you for contributing to naz.
Every contribution to naz is important.
Contributions are under the MIT License.
Answer the following questions,
What(What have you changed?)
data_coding
should not be applied to all fields that are of type C-octet stringutf8
for encoding/decodingWhy(Why did you change it?)
see; section 3.1 of SMPP spec
Thus we need to encode any field that is a C-Octet strings as ascii and also terminate them with NULL char(chr(0).encode())
eg,
system_id.encode("ascii") + chr(0).encode()
Also they should be decoded as such;
message_id.decode('ascii')
References: