Commit 90bd11e3 authored by Matthieu Gautier's avatar Matthieu Gautier
Browse files

Add a option input_enc to be able to properly open a template file.

parent 2495d80a
......@@ -623,7 +623,7 @@ def build(project, opts):
if 'template' in page:
fname = opj(project, page['template'])
with open(fname, 'r', opts.input_enc) as fp:
with open(fname, 'r', encoding=opts.input_enc) as fp:
template = fp.read()
else:
template = default_template
......@@ -709,6 +709,8 @@ def options():
og.add_option("" , "--dry-run", action="store_true", default=False,
help="go through the rendering process without actually "
"outputting/deleting any files")
og.add_option("", "--input_enc", default="utf8",
help="Encoding used to read input files")
op.add_option_group(og)
og = optparse.OptionGroup(op, "Serve options")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment