Enforce utf-8 enconding in output_file.

Pretends to fix #682 enforcing the utf-8 enconding.