diff --git a/src/StrawberryShake/Tooling/src/dotnet-graphql/DefaultFileSystem.cs b/src/StrawberryShake/Tooling/src/dotnet-graphql/DefaultFileSystem.cs index 51e210b0ceb..ed943cc5f6b 100644 --- a/src/StrawberryShake/Tooling/src/dotnet-graphql/DefaultFileSystem.cs +++ b/src/StrawberryShake/Tooling/src/dotnet-graphql/DefaultFileSystem.cs @@ -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 ReadAllBytesAsync(string fileName) => Task.Run(() => File.ReadAllBytes(fileName));