# -*- coding: utf-8 -*-
src = open('./src/backdoc.py', 'r').read()
markdown2_src = open('./src/markdown2.py', 'r').read()
template_src = "template_html = u'''{0}'''".format(open('./src/template.html', 'r').read())

compiled_src = (
    src.replace('from markdown2 import Markdown', markdown2_src)
       .replace("template_html = open('./template.html', 'r').read()", template_src)
)

compile_to = open('./backdoc.py', 'w')
compile_to.write(compiled_src)
# -*- coding: utf-8 -*-
src = open('./src/backdoc.py', 'r', encoding='utf-8').read()
markdown2_src = open('./src/markdown2.py', 'r', encoding='utf-8').read()
template_src = "template_html = u'''{0}'''".format(open('./src/template.html', 'r', encoding='utf-8').read())

compiled_src = (
    src.replace('from markdown2 import Markdown', markdown2_src)
       .replace("template_html = open('./template.html', 'r').read()", template_src)
)

compile_to = open('./backdoc.py', 'w', encoding='utf-8')
compile_to.write(compiled_src)
Set utf-8 encoding for all file connections in compile.py.