marcuz / libpynexmo

Python library to interact with Nexmo SMS API
BSD 2-Clause "Simplified" License
63 stars 34 forks source link

Lib forces unicode encoding when sending non ascii characters, even if they are in the GSM 03.38 alphabet #21

Open f-ld opened 9 years ago

f-ld commented 9 years ago

Hi,

When sending a text message, the library tries to decode the message as ascii and if it fails then encodes the text as utf-8 and sets the type parameter to unicode which is not correct.

For example, there are many characters in the GSM 03.38 alphabet that are not ascii but do not require unicode encoding. Flagging these messages as type=unicode implies that the maximum length allowed for messages decreases to 70 characters and makes many messages to be sent as multipart (and charged for each part) while it's not required.

Finally, this may cause some encoding issues with some network or phones.

Best regards, Fabien