From 47da3ed12b6359306d36c145cf2df3a78c34bb25 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 25 Jan 2018 15:03:07 +0100 Subject: Handling UTF-8 with BOM configuration files --- jfr_playoff/settings.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jfr_playoff/settings.py b/jfr_playoff/settings.py index 0bb61fc..ba03d72 100644 --- a/jfr_playoff/settings.py +++ b/jfr_playoff/settings.py @@ -29,7 +29,8 @@ class PlayoffSettings(object): 'JSON settings file: ').decode(sys.stdin.encoding) if self.settings is None: - self.settings = json.load(open(unicode(self.settings_file))) + self.settings = json.loads( + open(unicode(self.settings_file)).read().decode('utf-8-sig')) def has_section(self, key): self.load() -- cgit v1.2.3