Skip to content

Commit

Permalink
Use UTF-8 in reading...
Browse files Browse the repository at this point in the history
This effects operator and character table creation in mathics-core
  • Loading branch information
rocky committed Aug 29, 2024
1 parent 6573852 commit 37ba2f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mathics_scanner/generate/build_operator_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def compile_tables(data: Dict[str, dict]) -> Dict[str, dict]:
"data_dir", type=click.Path(readable=True), default=DEFAULT_DATA_DIR, required=False
)
def main(output, data_dir):
with open(data_dir / "operators.yml", "r") as i, open(output, "w") as o:
with open(data_dir / "operators.yml", "r", encoding="utf8") as i, open(
output, "w"
) as o:
# Load the YAML data.
data = yaml.load(i, Loader=yaml.FullLoader)

Expand Down
4 changes: 3 additions & 1 deletion mathics_scanner/generate/build_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ def compile_tables(data: dict) -> dict:
"data_dir", type=click.Path(readable=True), default=DEFAULT_DATA_DIR, required=False
)
def main(field, output, data_dir):
with open(data_dir / "named-characters.yml", "r") as i, open(output, "w") as o:
with open(data_dir / "named-characters.yml", "r", encoding="utf8") as i, open(
output, "w"
) as o:
# Load the YAML data.
data = yaml.load(i, Loader=yaml.FullLoader)

Expand Down

0 comments on commit 37ba2f6

Please sign in to comment.