-
-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Description
Hi the FileMock.WriteAllLines use "Encoding.Default" (which in this case seems to be what system is set to if Net framework is used) which doesn't seems to be correct to original API File.WriteAllLines (https://learn.microsoft.com/en-us/dotnet/api/system.io.file.writealltext?view=net-9.0#system-io-file-writealltext(system-string-system-string)) it has remark that default should be UTF8 without BOM
This method uses UTF-8 encoding without a Byte-Order Mark (BOM), so using the GetPreamble method will return an empty byte array. If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the WriteAllText(String, String, Encoding) method overload with UTF8 encoding.