The default encoding for snapshot files uses UTF-8 with byte order marks (BOM) enable. To disable UTF-8 BOMs, call VerifierSettings.UseUtf8NoBom
.
public static class ModuleInitializer
{
[ModuleInitializer]
public static void Init() =>
VerifierSettings.UseUtf8NoBom();
}
To override the encoding used for snapshot files, replacing the default UTF-8 encoding, call VerifierSettings.UseEncoding
providing a System.Text.Encoding
instance.
public static class ModuleInitializer
{
[ModuleInitializer]
public static void Init()
{
var encoding = new UnicodeEncoding(
bigEndian: false,
byteOrderMark: true,
throwOnInvalidBytes: true);
VerifierSettings.UseEncoding(encoding);
}
}