diff options
Diffstat (limited to 'lib/python/qmk/keymap.py')
-rw-r--r-- | lib/python/qmk/keymap.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py index 266532f50..d8495c38b 100644 --- a/lib/python/qmk/keymap.py +++ b/lib/python/qmk/keymap.py | |||
@@ -42,7 +42,7 @@ def template_json(keyboard): | |||
42 | template_file = Path('keyboards/%s/templates/keymap.json' % keyboard) | 42 | template_file = Path('keyboards/%s/templates/keymap.json' % keyboard) |
43 | template = {'keyboard': keyboard} | 43 | template = {'keyboard': keyboard} |
44 | if template_file.exists(): | 44 | if template_file.exists(): |
45 | template.update(json.loads(template_file.read_text())) | 45 | template.update(json.load(template_file.open(encoding='utf-8'))) |
46 | 46 | ||
47 | return template | 47 | return template |
48 | 48 | ||
@@ -58,7 +58,7 @@ def template_c(keyboard): | |||
58 | """ | 58 | """ |
59 | template_file = Path('keyboards/%s/templates/keymap.c' % keyboard) | 59 | template_file = Path('keyboards/%s/templates/keymap.c' % keyboard) |
60 | if template_file.exists(): | 60 | if template_file.exists(): |
61 | template = template_file.read_text() | 61 | template = template_file.read_text(encoding='utf-8') |
62 | else: | 62 | else: |
63 | template = DEFAULT_KEYMAP_C | 63 | template = DEFAULT_KEYMAP_C |
64 | 64 | ||
@@ -469,7 +469,7 @@ def parse_keymap_c(keymap_file, use_cpp=True): | |||
469 | if use_cpp: | 469 | if use_cpp: |
470 | keymap_file = _c_preprocess(keymap_file) | 470 | keymap_file = _c_preprocess(keymap_file) |
471 | else: | 471 | else: |
472 | keymap_file = keymap_file.read_text() | 472 | keymap_file = keymap_file.read_text(encoding='utf-8') |
473 | 473 | ||
474 | keymap = dict() | 474 | keymap = dict() |
475 | keymap['layers'] = _get_layers(keymap_file) | 475 | keymap['layers'] = _get_layers(keymap_file) |