titilambert/HeySms — pull request #15 by stesie (2012-10-03 11:50:34+00:00)
Title: Send messages using GSM-7 alphabet if possible

hi again :-)

I've improved the PDU generation code to use the GSM-7 alphabet if possible. This is, if the user provides a message consisting solely of characters that are available in the GSM-7 alphabet, that one is used. In that very case a single SMS may consist of up to 160 chars.

If a message with Unicode-only chars is to be sent (e.g. one containing the Euro sign), then UCS-2 is used to encode the message into PDU format like before. Then however a single SMS can only hold up to 70 chars.

Besides I've fixed the indentation in lib_sms.py. The whole project seems to indent blocks by 4 extra spaces. However in lib_sms.py there were some functions that added 8 spaces...

cheers,
stesie