We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
I've found a situation when after encoding and decoding text is not equal to source text. Example
text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà' print(codec.decode(codec.encode(text)) == text) False print(codec.decode(codec.encode(text))) ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà@
we can see that after encoding/decoding an extra symbol "@" is added.
The text was updated successfully, but these errors were encountered:
Thanks for the report.
Do you already have an idea why this might happen?
Sorry, something went wrong.
It seems like you have been using the GSM encoding.
There is a caveat that requires padding in certain situations:
https://github.com/qotto/smspdudecoder/blob/master/smspdudecoder/codecs.py#L87
In your case, you should consider using the following code:
from smspdudecoder.codecs import GSM text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà' assert GSM.decode(GSM.encode(text, with_padding=True), strip_padding=True) == text
I probably need to create a new version of the package where padding is enabled by default, to be in-line with the GSM specifications:
Hello, a quick update here.
This will be taken care of in the upcoming v3 of the library.
No branches or pull requests
Hi,
I've found a situation when after encoding and decoding text is not equal to source text. Example
text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà'
print(codec.decode(codec.encode(text)) == text)
False
print(codec.decode(codec.encode(text)))
ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÑܧ¿abcdefghijklmnopqrstuvwxyzäöñüà@
we can see that after encoding/decoding an extra symbol "@" is added.
The text was updated successfully, but these errors were encountered: