From 8c5ed688476da64cbea17b34f1eacc76bac1d9c7 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 8 Sep 2020 20:06:04 +0200 Subject: [PATCH] C#: Use BOM when creating a solution At least on Windows there seems to be issues if the solution has no BOM and contains a project with cyrillic chars. (cherry picked from commit 1c74fa42424d6a6cbf0cdd5b42f7bb54a1b9d7cd) --- .../GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs index 6f318aab4a2..cc0da44a13d 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/DotNetSolution.cs @@ -2,6 +2,7 @@ using GodotTools.Core; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Text.RegularExpressions; namespace GodotTools.ProjectEditor @@ -88,7 +89,7 @@ namespace GodotTools.ProjectEditor string solutionPath = Path.Combine(DirectoryPath, Name + ".sln"); string content = string.Format(SolutionTemplate, projectsDecl, slnPlatformsCfg, projPlatformsCfg); - File.WriteAllText(solutionPath, content); + File.WriteAllText(solutionPath, content, Encoding.UTF8); // UTF-8 with BOM } public DotNetSolution(string name)