Skip to content

Commit eff5968

Browse files
Merge pull request #34 from me-jain-anurag/fix/unicode-encoding-windows
fix: add UTF-8 encoding to file writes in edgeflowc.py
2 parents 869aabc + 9c590a9 commit eff5968

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/edgeflow/compiler/edgeflowc.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -834,15 +834,15 @@ def main() -> int:
834834
files["tensorrt"] = os.path.join(output_dir, "inference_tensorrt.py")
835835
files["report"] = os.path.join(output_dir, "optimization_report.md")
836836

837-
with open(files["python"], "w") as f:
837+
with open(files["python"], "w", encoding="utf-8") as f:
838838
f.write(python_code)
839-
with open(files["cpp"], "w") as f:
839+
with open(files["cpp"], "w", encoding="utf-8") as f:
840840
f.write(cpp_code)
841-
with open(files["onnx"], "w") as f:
841+
with open(files["onnx"], "w", encoding="utf-8") as f:
842842
f.write(onnx_code)
843-
with open(files["tensorrt"], "w") as f:
843+
with open(files["tensorrt"], "w", encoding="utf-8") as f:
844844
f.write(tensorrt_code)
845-
with open(files["report"], "w") as f:
845+
with open(files["report"], "w", encoding="utf-8") as f:
846846
f.write(report)
847847

848848
logging.info("Saved generated files to %s:", output_dir)
@@ -927,7 +927,7 @@ def main() -> int:
927927
explainability_path = os.path.join(
928928
output_dir, "explainability_report.md"
929929
)
930-
with open(explainability_path, "w") as f:
930+
with open(explainability_path, "w", encoding="utf-8") as f:
931931
f.write(explainability_report)
932932

933933
logging.info(

0 commit comments

Comments
 (0)