Skip to content

Commit e338b45

Browse files
committed
use utf-8 encoding for writing files (fix windows bug)
1 parent 0580524 commit e338b45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

casparser/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def print_summary(data, tablefmt="fancy_grid", output_filename=None, include_zer
171171
click.echo(tabulate(rows, header, tablefmt=fmt, colalign=col_align))
172172

173173
if output_filename:
174-
with open(output_filename, "w", encoding='utf-8') as f:
174+
with open(output_filename, "w", encoding="utf-8") as f:
175175
f.write(tabulate(rows, header, tablefmt=tablefmt, colalign=col_align))
176176
click.echo("File saved : " + click.style(output_filename, bold=True))
177177

@@ -232,7 +232,7 @@ def cli(output, summary, password, include_all, force_pdfminer, filename):
232232
)
233233
if output_ext in (".csv", ".json"):
234234
conv_fn = cas2json if output_ext == ".json" else cas2csv
235-
with open(output, "w", newline="", encoding='utf-8') as fp:
235+
with open(output, "w", newline="", encoding="utf-8") as fp:
236236
fp.write(conv_fn(data))
237237
click.echo("File saved : " + click.style(output, bold=True))
238238

0 commit comments

Comments
 (0)