make utf-8 work with .rst files
Chris Wanstrath chris@ozmm.org
Mon, 29 Mar 2010 17:26:01 -0700
3 files changed,
5 insertions(+),
2 deletions(-)
M
lib/github/commands/rest2html
→
lib/github/commands/rest2html
@@ -14,6 +14,8 @@ except:
pass import sys +import codecs + from docutils.core import publish_parts from docutils.writers.html4css1 import Writer@@ -35,7 +37,7 @@ Usage: rest2html < README.rst
rest2html README.rst """ try: - text = open(sys.argv[1], 'r').read() + text = codecs.open(sys.argv[1], 'r', 'utf-8').read() except IOError: # given filename could not be found return '' except IndexError: # no filename given
M
test/markups/README.rst
→
test/markups/README.rst
@@ -10,4 +10,4 @@ 1. Blah blah ``code`` blah
2. More ``code``, hooray - +3. Somé UTF-8°
M
test/markups/README.rst.html
→
test/markups/README.rst.html
@@ -7,6 +7,7 @@ <h2>Header 2</h2>
<ol class="arabic simple"> <li>Blah blah <tt class="docutils literal">code</tt> blah</li> <li>More <tt class="docutils literal">code</tt>, hooray</li> +<li>Somé UTF-8°</li> </ol> </div> </div>