-
-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathstrip_bom.csx
More file actions
21 lines (19 loc) · 929 Bytes
/
strip_bom.csx
File metadata and controls
21 lines (19 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
var files = new[]
{
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Contacts\Add.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Contacts\Edit.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Contacts\View.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Dispatch\NewCall.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Dispatch\UpdateCall.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Units\EditUnit.cshtml",
@"G:\Resgrid\Resgrid\Web\Resgrid.Web\Areas\User\Views\Units\NewUnit.cshtml",
};
foreach (var file in files)
{
var bytes = System.IO.File.ReadAllBytes(file);
int start = 0;
if (bytes.Length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF)
start = 3;
System.IO.File.WriteAllBytes(file, bytes[start..]);
Console.WriteLine($"Processed: {file} (start={start})");
}