mirror of
https://github.com/achiez/NebulaAuth-Steam-Desktop-Authenticator-by-Achies.git
synced 2026-07-25 06:14:31 +00:00
fix: set explicit no BOM UTF8 encoding when exporting mafiles to zip file
This commit is contained in:
@@ -16,6 +16,8 @@ namespace NebulaAuth.Model.MafileExport;
|
||||
|
||||
public static class MafileExporter
|
||||
{
|
||||
private static readonly UTF8Encoding Utf8NoBom = new(encoderShouldEmitUTF8Identifier: false);
|
||||
|
||||
public static async Task<ExportResult> ExportMafiles(IEnumerable<string> keys, MafileExportTemplate template)
|
||||
{
|
||||
if (template.Path == null || !PathIsValid(template.Path))
|
||||
@@ -80,7 +82,7 @@ public static class MafileExporter
|
||||
|
||||
var entry = archive.CreateEntry(fileName);
|
||||
await using var entryStream = entry.Open();
|
||||
await using var writer = new StreamWriter(entryStream, Encoding.UTF8);
|
||||
await using var writer = new StreamWriter(entryStream, Utf8NoBom);
|
||||
await writer.WriteAsync(content);
|
||||
exported[maf] = fileName;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user