On Mon, Jul 31, 2017 at 3:39 PM, bruce <badoug...@gmail.com> wrote: > > So, is there a quick/dirty approach I can use to simply strip out the > "non-ascii" chars. I know, this might not be the "best/pythonic" way, > and that it might result in loss of some data/chars, but I can live > with it for now.
Ignore or replace the non-ASCII characters. For example: >>> print 's\xffp\xffa\xffm'.decode('ascii', 'ignore') spam >>> print 's\xffp\xffa\xffm'.decode('ascii', 'replace') s�p�a�m _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor