Missing Unicode Codecs On Kivy/python On Android?
I have a program running under kivy that works fine on Windows but fails on opening a file on Android (1.8.0 on both platforms). The odd thing is that the error message indicates i
Solution 1:
Get rid of the try/except and look at the real exception. codecs.BOM
is a byte string \xff\xfe
and it is being coerced into Unicode using the default ascii
codec:
>>> import codecs
>>> codecs.BOM
'\xff\xfe'
>>> u'test'.lstrip(codecs.BOM)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
Baca Juga
- Kivy - How Do I Restrict The Imagebutton Click Space To Only On The Image Itself? (and Not The Blank "occupied" Space)?
- Kivy: How To Display A Widget While Waiting For Another One To Be Displayed (both Called From A Same Event)
- Is It Possible In Kivy Gridlayout To Specify A Particular Grid For A Particular Widget
Post a Comment for "Missing Unicode Codecs On Kivy/python On Android?"