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 1c74fa4242)
This commit is contained in:
Ignacio Etcheverry 2020-09-08 20:06:04 +02:00 committed by Rémi Verschelde
parent 93c15c2e97
commit 8c5ed68847
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ using GodotTools.Core;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace GodotTools.ProjectEditor namespace GodotTools.ProjectEditor
@ -88,7 +89,7 @@ namespace GodotTools.ProjectEditor
string solutionPath = Path.Combine(DirectoryPath, Name + ".sln"); string solutionPath = Path.Combine(DirectoryPath, Name + ".sln");
string content = string.Format(SolutionTemplate, projectsDecl, slnPlatformsCfg, projPlatformsCfg); 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) public DotNetSolution(string name)