Skip to content

Commit

Permalink
fix(config_reader): add utf-8 encoding when reading config file
Browse files Browse the repository at this point in the history
Specify utf-8 encoding when opening the configuration file to ensure
compatibility with files containing non-ASCII characters, avoiding potentialencoding errors.
  • Loading branch information
myhloli committed Jul 24, 2024
1 parent ca737d5 commit d244a1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion magic_pdf/libs/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def read_config():
if not os.path.exists(config_file):
raise FileNotFoundError(f"{config_file} not found")

with open(config_file, "r") as f:
with open(config_file, "r", encoding="utf-8") as f:
config = json.load(f)
return config

Expand Down

0 comments on commit d244a1c

Please sign in to comment.