Skip to content

Commit

Permalink
make utf-8 work with .rst files
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Mar 30, 2010
1 parent bfc89e4 commit cd04f07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/github/commands/rest2html
Expand Up @@ -14,6 +14,8 @@ except:
pass

import sys
import codecs

from docutils.core import publish_parts
from docutils.writers.html4css1 import Writer

Expand All @@ -35,7 +37,7 @@ def main():
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
Expand Down
2 changes: 1 addition & 1 deletion test/markups/README.rst
Expand Up @@ -10,4 +10,4 @@ Header 2

2. More ``code``, hooray


3. Somé UTF-8°
1 change: 1 addition & 0 deletions test/markups/README.rst.html
Expand Up @@ -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>
Expand Down

0 comments on commit cd04f07

Please sign in to comment.