Skip to content

Commit

Permalink
fix: use utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
gusye1234 committed Sep 18, 2024
1 parent 8b96a3f commit c2e6759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nano_graphrag/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ def compute_mdhash_id(content, prefix: str = ""):


def write_json(json_obj, file_name):
with open(file_name, "w", encoding='utf-8') as f:
with open(file_name, "w", encoding="utf-8") as f:
json.dump(json_obj, f, indent=2, ensure_ascii=False)


def load_json(file_name):
if not os.path.exists(file_name):
return None
with open(file_name) as f:
with open(file_name, encoding="utf-8") as f:
return json.load(f)


Expand Down

0 comments on commit c2e6759

Please sign in to comment.