-
Notifications
You must be signed in to change notification settings - Fork 134
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
Use GSM(packed) to encode and then decode, there is an extra '@' character #108
Comments
There is another question. As mentioned in GSM 03.38, if the first 7 bits of the last byte are all 0 after packing, a CR(0x0d) should be filled to the last byte to avoid confusion with
For example, the source input is "1234567890abcdefghijklm". After encoding and packing, we will get m := []byte{49,217,140,86,179,221,112,57,88,88,60,38,151,205,103,116,90,189,102,183,1} the last byte is '1', m1 := []byte{49,217,140,86,179,221,112,57,88,88,60,38,151,205,103,116,90,189,102,183,27} But when I tried to decode m1, I got "1234567890abcdefghijklm\r" Yes, the extra characters become '\r'. |
After my deduction, when the encoded length of the original input satisfies the arithmetic sequence For example:
|
here it is the fix: #109 |
Question
GSM7 (Packed), encode first, and then decode the encoded result, which is inconsistent with the original input, and there are more '@' characters
For example
My source input was
"1234567890abcdefghijklm"
Firstly I encoded it to a bytes slice m
Then I Decoded the m, but got
"1234567890abcdefghijklm@"
There was one more character '@' than the original input.
Here is my test codes:
The text was updated successfully, but these errors were encountered: