diff --git a/marimo/_cli/convert/commands.py b/marimo/_cli/convert/commands.py index cd139f30acb..b39b77bffbb 100644 --- a/marimo/_cli/convert/commands.py +++ b/marimo/_cli/convert/commands.py @@ -64,7 +64,7 @@ def convert( if output: # Make dirs if needed maybe_make_dirs(output) - with open(output, "w") as f: + with open(output, "w", encoding="utf-8") as f: f.write(notebook) echo(f"Converted notebook saved to {output}") else: diff --git a/marimo/_cli/export/commands.py b/marimo/_cli/export/commands.py index 7a2a01912d8..8af8a7c19ff 100644 --- a/marimo/_cli/export/commands.py +++ b/marimo/_cli/export/commands.py @@ -45,7 +45,7 @@ def write_data(data: str) -> None: if output: # Make dirs if needed maybe_make_dirs(output) - with open(output, "w") as f: + with open(output, "w", encoding="utf-8") as f: f.write(data) f.close() else: