Skip to content

Commit

Permalink
get-codec: set encoding when writing csv
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnth committed Apr 4, 2024
1 parent ba5ee4d commit 0c9b342
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pagetools/cli/analytics/get_codec.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def serialize(codec: dict, output, out_format: str, freq: bool, text_output_newl
elif out_format == "csv":
header = ["character", "frequency"]

with open(output, "w") as outfile:
with open(output, "w", encoding="utf-8") as outfile:
csv_writer = csv.writer(outfile, delimiter=",", quotechar='"', quoting=csv.QUOTE_ALL)
csv_writer.writerow(header)
for row in codec:
Expand Down

0 comments on commit 0c9b342

Please sign in to comment.