UnicodeEncodeError: 'ascii' codec can't encode character?
问题 I'm trying to pass big strings of random html through regular expressions and my Python 2.6 script is choking on this: UnicodeEncodeError: 'ascii' codec can't encode character I traced it back to a trademark superscript on the end of this word: Protection™ -- I do not need to capture the non-ascii stuff, but it is a nuisance and I expect to encounter it more in the future. Is there a module to process non-ascii characters? or, what is the best way to handle/escape non-ascii stuff in python?