Skip to content

Commit

Permalink
Avoid writing BOM in StrawberryShake Tools (#6751)
Browse files Browse the repository at this point in the history
  • Loading branch information
glen-84 authored Dec 7, 2023
1 parent 498c685 commit 0e63272
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public string ResolvePath(string? path, string? fileName)
}

public Task WriteTextAsync(string fileName, string text) =>
Task.Run(() => File.WriteAllText(fileName, text, Encoding.UTF8));
Task.Run(() => File.WriteAllText(
fileName,
text,
new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true)));

public Task<byte[]> ReadAllBytesAsync(string fileName) =>
Task.Run(() => File.ReadAllBytes(fileName));
Expand Down

0 comments on commit 0e63272

Please sign in to comment.