1.1 --- a/moinformat/themes/common.py Sat Apr 13 00:26:57 2019 +0200
1.2 +++ b/moinformat/themes/common.py Sat Apr 13 19:25:53 2019 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Theming common functionality.
1.6
1.7 -Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2018, 2019 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -22,11 +22,14 @@
1.13 from os import listdir, makedirs
1.14 from os.path import exists, isfile, join, split
1.15 from shutil import copy
1.16 +import codecs
1.17
1.18 class Theme:
1.19
1.20 "A common theme abstraction."
1.21
1.22 + default_encoding = "utf-8"
1.23 +
1.24 def __init__(self, metadata):
1.25
1.26 "Initialise the theme with the given 'metadata'."
1.27 @@ -91,7 +94,7 @@
1.28
1.29 "Return the textual content of the resource with the given 'filename'."
1.30
1.31 - f = open(self.get_resource(filename))
1.32 + f = codecs.open(self.get_resource(filename), encoding=self.default_encoding)
1.33 try:
1.34 return f.read()
1.35 finally: