Ceasar/staticjinja — pull request #12 by upsilon (2013-03-23 16:12:01+00:00)
Title: Add utf8 support

When the template contains UTF-8 characters, build.py will fail with TypeError.
This patch fixes the issue and adds `encoding` argument to `staticjinja.main()`. Defaults to utf8.

```
Building test.html...
Traceback (most recent call last):
File "./build.py", line 6, in
staticjinja.main()
File "/usr/local/lib/python2.7/dist-packages/staticjinja/staticjinja.py", line 123, in main
build_all()
File "/usr/local/lib/python2.7/dist-packages/staticjinja/staticjinja.py", line 121, in build_all
rules=rules)
File "/usr/local/lib/python2.7/dist-packages/staticjinja/staticjinja.py", line 87, in render_templates
build_template(env, template, outpath, **context)
File "/usr/local/lib/python2.7/dist-packages/staticjinja/staticjinja.py", line 29, in build_template
template.stream(**kwargs).dump(os.path.join(outpath, template.name))
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1072, in dump
fp.writelines(iterable)
TypeError: writelines() argument must be a sequence of strings
```

Example (test.html):
``` html

utf8 test

いろはにほへと　ちりぬるを
```