When using the library, I came across a small bug preventing some SMS from being sent.
Only messages between 70 and 140 characters would fail when sent with the UCS-2 encoding. If the message is short or long enough, it does not fall in this particular case.
By digging a bit I saw that message length is calculated before encoding conversion, creating a mismatch between the actual length of the string and the one used for comparison.
Thus adding a strlen after re-encoding the message fixes it.
When using the library, I came across a small bug preventing some SMS from being sent.
Only messages between 70 and 140 characters would fail when sent with the UCS-2 encoding. If the message is short or long enough, it does not fall in this particular case.
By digging a bit I saw that message length is calculated before encoding conversion, creating a mismatch between the actual length of the string and the one used for comparison.
Thus adding a strlen after re-encoding the message fixes it.