Skip to content

Commit

Permalink
Force encoding when loading files
Browse files Browse the repository at this point in the history
  • Loading branch information
suchmememanyskill committed Aug 14, 2024
1 parent f5609b9 commit e21965d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion css_inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self, cssPath : str, tabs : List[str], theme):

async def load(self) -> Result:
try:
with open(self.cssPath, "r") as fp:
with open(self.cssPath, "r", encoding="utf-8") as fp:
self.css = fp.read()

split_css = re.split(r"(\.[_a-zA-Z]+[_a-zA-Z0-9-]*)", self.css)
Expand Down
2 changes: 1 addition & 1 deletion css_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ async def _parse_themes(self, themesDir : str, configDir : str = None) -> list[t
try:
theme = None
if path.exists(themeDataPath):
with open(themeDataPath, "r") as fp:
with open(themeDataPath, "r", encoding="utf-8") as fp:
theme = json.load(fp)

themeData = Theme(themePath, theme, configPath)
Expand Down

0 comments on commit e21965d

Please sign in to comment.