diff --git a/src/opnsense/service/configd.py b/src/opnsense/service/configd.py index cfbb45db6..d3cd5126c 100755 --- a/src/opnsense/service/configd.py +++ b/src/opnsense/service/configd.py @@ -1,4 +1,5 @@ #!/usr/local/bin/python2.7 +# -*- coding: utf-8 -*- """ Copyright (c) 2014 Ad Schellevis diff --git a/src/opnsense/service/modules/template.py b/src/opnsense/service/modules/template.py index 9db3912e1..f25a27df2 100644 --- a/src/opnsense/service/modules/template.py +++ b/src/opnsense/service/modules/template.py @@ -33,6 +33,7 @@ import os.path import syslog import collections import copy +import codecs import jinja2 import addons.template_helpers @@ -264,7 +265,7 @@ class Template(object): # make sure the target directory exists self._create_directory(filename) - f_out = open(filename, 'wb') + f_out = codecs.open(filename, 'wb', encoding="utf-8") f_out.write(content) # Check if the last character of our output contains an end-of-line, if not copy it in if # it was in the original template.