dotnet/msbuild

WriteLinesToFile Does Not Support BOM Customization

Open

#6,168 建立於 2021年2月17日

在 GitHub 查看
 (0 留言) (4 反應) (0 負責人)C# (1,364 fork)batch import
help wantedneeds-designtriaged

倉庫指標

Star
 (5,062 star)
PR 合併指標
 (平均合併 11天 7小時) (30 天內合併 125 個 PR)

描述

Context

The WriteLinesToFile task uses UTF-8 encoding without BOM (byte order mark) by default. This is not specified in the documentation and could be useful to have control over.

The difficulty is allowing control over the optional Encoding parameter and control over the BOM without adding a special case for every single encoding.

Some options I sent in the internal thread that started this issue:

  1. We pick a few encodings that are most common/popular/etc. and special case those and no others.
  2. We can pass an optional parameter to override whether s_defaultEncoding applies a BOM.

Let's discuss what potential solutions there are before implementing an improvement.

貢獻者指南