[Tutor] changing unicode to ascii

Benjamin Fishbein bfishbein79 at gmail.com
Wed Jan 30 19:05:04 CET 2013


>  Using text.encode("ascii", "ignore") should absolutely work. You could also just write the file in UTF-8 if you don't absolutely need ascii by using text.encode("utf-8").
> 
> Hugo
You're right. It does work. I forgot to assign the result to a variable:
text = text.encode("ascii", "ignore")
Thanks.



More information about the Tutor mailing list