@@ -295,7 +295,7 @@ def load_template(
295295 if not template_path .exists ():
296296 raise FileNotFoundError (f"Template not found: { template_path } " )
297297
298- return template_path .read_text ()
298+ return template_path .read_text (encoding = "utf-8" )
299299
300300
301301def render_template (template_str : str , data : TemplateData ) -> str :
@@ -408,7 +408,7 @@ def write_file(path: Path, content: str, force: bool = False) -> bool:
408408 return False
409409
410410 path .parent .mkdir (parents = True , exist_ok = True )
411- path .write_text (content )
411+ path .write_text (content , encoding = "utf-8" )
412412 print (f"Generated: { path } " )
413413 return True
414414
@@ -452,7 +452,9 @@ def generate_project(
452452 # Create __init__.py files
453453 init_file = d / "__init__.py"
454454 if not init_file .exists ():
455- init_file .write_text ('"""Auto-generated by telemetryflow-restapi."""\n ' )
455+ init_file .write_text (
456+ '"""Auto-generated by telemetryflow-restapi."""\n ' , encoding = "utf-8"
457+ )
456458
457459 # Generate project files using templates
458460 project_tpl_dir = template_dir / "project" if template_dir else None
@@ -749,7 +751,7 @@ def cmd_entity(args: argparse.Namespace) -> int:
749751 pyproject_path = output_dir / "pyproject.toml"
750752 module_name = ""
751753 if pyproject_path .exists ():
752- content = pyproject_path .read_text ()
754+ content = pyproject_path .read_text (encoding = "utf-8" )
753755 for line in content .split ("\n " ):
754756 if line .startswith ("name = " ):
755757 module_name = line .split ("=" )[1 ].strip ().strip ('"' )
0 commit comments