faucamp / python-gsmmodem

Python module to control a GSM modem attached to the system: send/receive SMS messages, handle calls, etc
GNU Lesser General Public License v3.0
385 stars 303 forks source link

How do you send accented characters? #92

Closed silgon closed 5 years ago

silgon commented 6 years ago

I would like to know how to send strings with accented characters. I don't find how (maybe I haven't look enough tough). So, let's say just to test, we have:

 str_to_send="áóéú"
tomchy commented 6 years ago

It should be done the same way as message with ASCII characters. There are some procedures that will try to encode it with GSM-7 character set, fail and send it using UTF-8.

If you are sending it from python script, check if setting character set inside it to UTF-8 solves your problem 🙂

Please make sure that you are using the fixed version of this library (python-gsmmodem-new) from forked repo.

silgon commented 5 years ago

Sorry for the super late answer. I needed that again today. You're completely right. Also tested it with python 3 and it works perfectly fine with python-gsmmodem-new.