dotnet/msbuild

WriteLinesToFile Does Not Support BOM Customization

Open

#6168 aperta il 17 feb 2021

Vedi su GitHub
 (0 commenti) (4 reazioni) (0 assegnatari)C# (1364 fork)batch import
help wantedneeds-designtriaged

Metriche repository

Star
 (5062 star)
Metriche merge PR
 (Merge medio 11g 7h) (125 PR mergiate in 30 g)

Descrizione

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.

Guida contributor