_template.py: fixing utf-8 stdout issues