Skip to content

Commit fdd3673

Browse files
committed
Write output in UTF-8 from CLI commands
1 parent d976e9f commit fdd3673

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

transport_data/org/cli.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def summarize(path_in: "pathlib.Path", path_out: Optional["pathlib.Path"], ref_a
7070
path_out = pathlib.Path.cwd().joinpath(f"{ref_areas[0]}.{{html,odt}}")
7171
print(f"Write to {path_out}")
7272
report.MetadataSet1HTML(mds, ref_area=ref_areas[0]).write_file(
73-
path_out.with_suffix(".html")
73+
path_out.with_suffix(".html"), encoding="utf-8"
7474
)
7575
report.MetadataSet1ODT(mds, ref_area=ref_areas[0]).write_file(
7676
path_out.with_suffix(".odt")
@@ -82,7 +82,7 @@ def summarize(path_in: "pathlib.Path", path_out: Optional["pathlib.Path"], ref_a
8282
print(f"Write to {path_out}")
8383
report.MetadataSet0ODT(mds).write_file(path_out.with_suffix(".odt"))
8484
report.MetadataSet2HTML(mds, ref_area=ref_areas).write_file(
85-
path_out.with_suffix(".html")
85+
path_out.with_suffix(".html"), encoding="utf-8"
8686
)
8787

8888

@@ -115,7 +115,9 @@ def _tuewas_all(path_in):
115115
print(f"Wrote {path_out[-1]}")
116116

117117
path_out.append(dir_out.joinpath("Metadata summary table.html"))
118-
report.MetadataSet2HTML(mds, ref_area=ref_areas).write_file(path_out[-1])
118+
report.MetadataSet2HTML(mds, ref_area=ref_areas).write_file(
119+
path_out[-1], encoding="utf-8"
120+
)
119121
print(f"Wrote {path_out[-1]}")
120122

121123
path_zip = dir_out.joinpath("all.zip")

0 commit comments

Comments
 (0)