I am trying to use premailer
to transform an html document that I've created into something that I can email with inline css styling. However when I try make the transform I am getting the following error:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/oldo/Python/virtual-environments/AMS-Journal/lib/python2.7/site-packages/premailer/__main__.py", line 142, in <module>
sys.exit(main(sys.argv[1:]))
File "/Users/oldo/Python/virtual-environments/AMS-Journal/lib/python2.7/site-packages/premailer/__main__.py", line 137, in main
options.outfile.write(p.transform(pretty_print=options.pretty))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 106688: ordinal not in range(128)
I've seen that there a plethora of questions by people coming up with similar problems however I can't seem to make any progress with rectifying the fault.
My file is encoded in utf-8
and so I am confused as to why I'm getting this error.
Would anyone have any suggestions on something that I can try to make some moves forward?