summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Miller <jack@codezen.org>2010-10-14 15:49:08 +0300
committerAntti Kaihola <akaihol+github@ambitone.com>2010-10-14 15:49:08 +0300
commitb6828c731162ba77015cc6cca837380c17407dc5 (patch)
treefce0571b964ae3661c13720f8596f1e7a3b8f102
parent62481c6366a562547b775b4415b43361933e7926 (diff)
downloadpycco-b6828c731162ba77015cc6cca837380c17407dc5.tar.gz
Fixes #1: applied themoken's UTF-8 patch
See issue 1: http://github.com/fitzgen/pycco/issues#issue/1 Original patch: http://codezen.org/static/encode.patch
-rwxr-xr-xpycco3
1 files changed, 2 insertions, 1 deletions
diff --git a/pycco b/pycco
index aaabb7b..e2f8f8f 100755
--- a/pycco
+++ b/pycco
@@ -135,7 +135,7 @@ def generate_html(source, sections):
})
print "pycco = %s -> %s" % (source, dest)
fh = open(dest, "w")
- fh.write(html)
+ fh.write(html.encode(getpreferredencoding()))
fh.close()
#### Helpers & Setup
@@ -152,6 +152,7 @@ from markdown import markdown
from os import path
from pygments import lexers, formatters
from subprocess import Popen, PIPE
+from locale import getpreferredencoding
# A list of the languages that Pycco supports, mapping the file extension to
# the name of the Pygments lexer and the symbol that indicates a comment. To