Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/188: data_coding should not be applied to all C-Octet String fields #190

Merged
merged 61 commits into from
Dec 5, 2019

Conversation

komuw
Copy link
Owner

@komuw komuw commented Dec 3, 2019

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?)

  • BugFix, data_coding should not be applied to all fields that are of type C-octet string
  • Have the naz messsage protocol only use utf8 for encoding/decoding

Why(Why did you change it?)

  • fixes: Bug: data_coding should not be applied to all fields that are C-Octet Strings #188
  • 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')

References:

@komuw komuw merged commit 309030d into master Dec 5, 2019
@komuw komuw deleted the issues/188 branch December 5, 2019 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: data_coding should not be applied to all fields that are C-Octet Strings
1 participant