From 4bab5e160c74fff79a8764e6e890168388d8c7ed Mon Sep 17 00:00:00 2001 From: sheyifan Date: Thu, 4 Dec 2025 14:16:21 +0800 Subject: [PATCH] fix: Incorrect encoding when reading UTF-8 markdown files --- md2cf/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/md2cf/document.py b/md2cf/document.py index 5ea2592..3a4807c 100644 --- a/md2cf/document.py +++ b/md2cf/document.py @@ -216,7 +216,7 @@ def get_page_data_from_file_path( file_path = Path(file_path) try: - with open(file_path) as file_handle: + with open(file_path, encoding='utf-8') as file_handle: markdown_lines = file_handle.readlines() except UnicodeDecodeError: with open(file_path, "rb") as file_handle: