Skip to content

Commit

Permalink
Merge pull request #23 from JackLeeHal/main
Browse files Browse the repository at this point in the history
add multi-language support for file read
  • Loading branch information
patillacode authored Jun 15, 2023
2 parents 3538a4c + acc0fee commit 68e4a58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def __init__(self, path):
os.makedirs(self.path, exist_ok=True)

def __getitem__(self, key):
with open(self.path / key) as f:
with open(self.path / key, encoding='utf-8') as f:
return f.read()

def __setitem__(self, key, val):
with open(self.path / key, 'w') as f:
with open(self.path / key, 'w', encoding='utf-8') as f:
f.write(val)


Expand Down

0 comments on commit 68e4a58

Please sign in to comment.