open both template and output files as utf-8