Comments (4)
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 @
.
When there are 7 spare bits in the last octet of a message, these bits are set to the 7-bit code of the CR control (also used as a padding filler) instead of being set to zero (where they would be confused with the 7-bit code of an '@' character).
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', 0000 0001
, which matches the scenario mentioned in the above article. So a CR(0x0d) should be filled to it, 1 | (0x0d << 1) = 27
, as 0001 1011
. Then the new encode result should be:
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'.
from go-smpp.
After my deduction, when the encoded length of the original input satisfies the arithmetic sequence
, the above situation will occur.
For example:
- s1 =
1234567890abcdefghijklm
, The original length is 23, there is no escape character, and the encoded length is also 23; - s2 =
12345678[abcdefghijklm
, The original length is 21, with the escape character '[', occupying two bytes. The length after encoding is also 23;
from go-smpp.
here it is the fix: #109
from go-smpp.
from go-smpp.
Related Issues (20)
- Using tx.Submit in thread HOT 2
- Easier way to manager delivery receipts - missing receipted_message_id and PDU Sequence Management HOT 1
- [QUESTION] - How to register multiple delivery for transceiver
- [BUG] - message encoding not working for long unicode message
- timeout waiting for response - RESOLVED using RespTimeout parameter HOT 5
- Converting the hex in text field of delivery receipt to original UCS2 text submitted
- Concatenated / Multipart
- Multipart Message using UCS2
- server example
- Concatenated problem HOT 1
- getValidityPeriod format YYMMDDhhmmssUTCR
- disconnect when receive data_sm HOT 2
- error in var udhList []UDH
- Using multiple tranceiver.Submit via go routines
- Error sending SMS with Golang SMPP protocol: Unknown address HOT 1
- How to reconnect when receive error not connected with error Connection reset by peer?
- wrong decode and encode for pdufield.UDHList HOT 1
- Utf support
- Check connected client(s) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-smpp.