@@ -85,7 +85,7 @@ async def write_file_atomic(path: FilePath, content: str) -> None:
8585 temp_path = path_obj .with_suffix (".tmp" )
8686
8787 try :
88- temp_path .write_text (content )
88+ temp_path .write_text (content , encoding = "utf-8" )
8989 temp_path .replace (path_obj )
9090 logger .debug ("Wrote file atomically" , path = str (path_obj ), content_length = len (content ))
9191 except Exception as e : # pragma: no cover
@@ -203,7 +203,7 @@ async def update_frontmatter(path: FilePath, updates: Dict[str, Any]) -> str:
203203 path_obj = Path (path ) if isinstance (path , str ) else path
204204
205205 # Read current content
206- content = path_obj .read_text ()
206+ content = path_obj .read_text (encoding = "utf-8" )
207207
208208 # Parse current frontmatter
209209 current_fm = {}
@@ -215,7 +215,7 @@ async def update_frontmatter(path: FilePath, updates: Dict[str, Any]) -> str:
215215 new_fm = {** current_fm , ** updates }
216216
217217 # Write new file with updated frontmatter
218- yaml_fm = yaml .dump (new_fm , sort_keys = False )
218+ yaml_fm = yaml .dump (new_fm , sort_keys = False , allow_unicode = True )
219219 final_content = f"---\n { yaml_fm } ---\n \n { content .strip ()} "
220220
221221 logger .debug ("Updating frontmatter" , path = str (path_obj ), update_keys = list (updates .keys ()))
0 commit comments