Skip to content

Commit

Permalink
chore: Change output html file encoding to UTF-8 (No BOM) (#9131)
Browse files Browse the repository at this point in the history
chore: change output html file encoding to UTF-8 (No BOM)
  • Loading branch information
filzrev authored Aug 25, 2023
1 parent c921f82 commit 505f7cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Docfx.Build.Engine/PostProcessors/HtmlPostProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace Docfx.Build.Engine;

internal sealed class HtmlPostProcessor : IPostProcessor
{
private static readonly UTF8Encoding Utf8EncodingWithoutBom = new(false);

public List<IHtmlDocumentHandler> Handlers { get; } = new List<IHtmlDocumentHandler>();

private bool _handlerInitialized;
Expand Down Expand Up @@ -79,7 +81,7 @@ where output.Key.Equals(".html", StringComparison.OrdinalIgnoreCase)
}
using (var stream = EnvironmentContext.FileAbstractLayer.Create(tuple.OutputFile))
{
document.Save(stream, Encoding.UTF8);
document.Save(stream, Utf8EncodingWithoutBom);
}
}
foreach (var handler in Handlers)
Expand Down

0 comments on commit 505f7cf

Please sign in to comment.