xdissent/jekyll-rst — pull request #9 by jcsp (2013-10-12 13:10:28+00:00)
Title: Fix output when input contains non-ascii character

main() returns a unicode object, and print has to encode this for output. When output to terminal this usually works (because your terminal is unicode), but when output is to a file print defaults to ascii.

When I have a source file with a £ in it, I would previously get:
File "plugins/jekyll-rst/rst2html.py", line 39, in
print(main())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 1246: ordinal not in range(128)

With this change it works cleanly, albeit hard coded for utf-8.