Skip to content

Commit 317b099

Browse files
committed
fix: write UTF-8 without BOM encoding for config files to avoid Windows compatibility issues
1 parent 5cec801 commit 317b099

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

UnityMcpBridge/Editor/Windows/MCPForUnityEditorWindow.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ private string WriteToConfig(string pythonDir, string configPath, McpClient mcpC
11061106

11071107
string mergedJson = JsonConvert.SerializeObject(existingRoot, jsonSettings);
11081108
string tmp = configPath + ".tmp";
1109-
System.IO.File.WriteAllText(tmp, mergedJson, System.Text.Encoding.UTF8);
1109+
// Write UTF-8 without BOM to avoid issues on Windows editors/tools
1110+
System.IO.File.WriteAllText(tmp, mergedJson, new System.Text.UTF8Encoding(false));
11101111
if (System.IO.File.Exists(configPath))
11111112
System.IO.File.Replace(tmp, configPath, null);
11121113
else

0 commit comments

Comments
 (0)