diff --git a/docling_core/types/doc/document.py b/docling_core/types/doc/document.py index 8a986ad1..2ce0f3af 100644 --- a/docling_core/types/doc/document.py +++ b/docling_core/types/doc/document.py @@ -1844,7 +1844,7 @@ def save_as_markdown( page_no=page_no, ) - with open(filename, "w") as fw: + with open(filename, "w", encoding="utf-8") as fw: fw.write(md_out) def export_to_markdown( # noqa: C901 @@ -2081,7 +2081,7 @@ def save_as_html( html_head=html_head, ) - with open(filename, "w") as fw: + with open(filename, "w", encoding="utf-8") as fw: fw.write(html_out) def _get_output_paths(