Skip to content

Commit db6fde6

Browse files
aksOpsclaude
andcommitted
Fix Windows encoding error when reading vendor JS files
Added explicit encoding='utf-8' to all file reads in render_html() to prevent cp1252 decode failures on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2daecc1 commit db6fde6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/code_intelligence/flow/renderer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def render_html(views: dict[str, FlowDiagram], stats: dict[str, Any], project_na
108108
views_data[name] = diagram.to_dict()
109109

110110
template_path = Path(__file__).parent / "templates" / "interactive.html"
111-
template = template_path.read_text()
111+
template = template_path.read_text(encoding="utf-8")
112112

113113
# Inline vendor JS for offline/firewall use
114114
vendor_dir = Path(__file__).parent / "vendor"
@@ -118,7 +118,7 @@ def render_html(views: dict[str, FlowDiagram], stats: dict[str, Any], project_na
118118
("{{VENDOR_CYTOSCAPE_DAGRE}}", "cytoscape-dagre.min.js"),
119119
]:
120120
vendor_path = vendor_dir / filename
121-
template = template.replace(placeholder, vendor_path.read_text())
121+
template = template.replace(placeholder, vendor_path.read_text(encoding="utf-8"))
122122

123123
html = template.replace("{{VIEWS_DATA}}", json.dumps(views_data, indent=2))
124124
html = html.replace("{{STATS}}", json.dumps(stats, indent=2))

0 commit comments

Comments
 (0)