I'm seeing an issue with ascii / unicode. The log is below.
Any ideas what could be the issue?
[2020-11-29 00:12:11,450] ERROR in app: Exception on /getsms [GET]
Traceback (most recent call last):
File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/pi/.local/lib/python2.7/site-packages/flask_restful/init.py", line 468, in wrapper
resp = resource(*args, kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/flask/views.py", line 89, in view
return self.dispatch_request(*args, *kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/flask_restful/init.py", line 583, in dispatch_request
resp = meth(args, kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/flask_httpauth.py", line 164, in decorated
return f(*args, **kwargs)
File "run.py", line 77, in get
sms_dict["Text"] = str(sms[0]['Text'])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 88: ordinal not in range(128)
Hi,
it seems, that receiving SMS lacks Unicode support.
I am not able to simulate it, but I hope adding sms[0]['Text'].encode('utf-8') should help you.
Hi
I'm seeing an issue with ascii / unicode. The log is below. Any ideas what could be the issue?
[2020-11-29 00:12:11,450] ERROR in app: Exception on /getsms [GET] Traceback (most recent call last): File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/pi/.local/lib/python2.7/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/home/pi/.local/lib/python2.7/site-packages/flask_restful/init.py", line 468, in wrapper resp = resource(*args, kwargs) File "/home/pi/.local/lib/python2.7/site-packages/flask/views.py", line 89, in view return self.dispatch_request(*args, *kwargs) File "/home/pi/.local/lib/python2.7/site-packages/flask_restful/init.py", line 583, in dispatch_request resp = meth(args, kwargs) File "/home/pi/.local/lib/python2.7/site-packages/flask_httpauth.py", line 164, in decorated return f(*args, **kwargs) File "run.py", line 77, in get sms_dict["Text"] = str(sms[0]['Text']) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 88: ordinal not in range(128)