Skip to content

Commit

Permalink
Merge pull request #8 from s10/fix/encodings
Browse files Browse the repository at this point in the history
fix: open templates with explicit utf-8 encoding
  • Loading branch information
azymohliad authored Dec 27, 2024
2 parents f708d3e + 78bdcd9 commit 9b816a0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions anki_addon/notetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class NoteTypeManager:
def __init__(self):
# Read default templates' markups and style
templates_dir = path.join(path.dirname(__file__), 'templates')
with open(path.join(templates_dir, 'style.css'), 'r') as file:
with open(path.join(templates_dir, 'style.css'), 'r', encoding='utf-8') as file:
style = file.read()
with open(path.join(templates_dir, 'into_estonian_front.html'), 'r') as file:
with open(path.join(templates_dir, 'into_estonian_front.html'), 'r', encoding='utf-8') as file:
markup_into_estonian_front = file.read()
with open(path.join(templates_dir, 'into_estonian_back.html'), 'r') as file:
with open(path.join(templates_dir, 'into_estonian_back.html'), 'r', encoding='utf-8') as file:
markup_into_estonian_back = file.read()
with open(path.join(templates_dir, 'from_estonian_front.html'), 'r') as file:
with open(path.join(templates_dir, 'from_estonian_front.html'), 'r', encoding='utf-8') as file:
markup_from_estonian_front = file.read()
with open(path.join(templates_dir, 'from_estonian_back.html'), 'r') as file:
with open(path.join(templates_dir, 'from_estonian_back.html'), 'r', encoding='utf-8') as file:
markup_from_estonian_back = file.read()

# Default card templates
Expand Down

0 comments on commit 9b816a0

Please sign in to comment.