I'm getting an encoding error from a script, as follows:
from django.template import loader, Context t = loader.get_template(filename) c = Context({'menus': menus}) print t.render(c) File "../django_to_html.py", line 45, in <module> print t.render(c) UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 34935: ordinal not in range(128) I don't own the script, so I don't have the ability to edit it. The only thing I can do is change the filename supplied so it doesn't contain the Unicode character to which the script is objecting.
This file is a text file that I'm editing in TextMate. What can I do to identify and get rid of the character that the script is barfing on?
Could I use something like iconv, and if so how?
Thanks!