PSScriptAnalyzer icon indicating copy to clipboard operation
PSScriptAnalyzer copied to clipboard

Remove UTF-8 BOM from text files

Open xtqqczze opened this issue 5 years ago • 5 comments

PR Summary

  • Remove UTF-8 BOM from text files.
  • Specify utf-8 charset in .editorconfig to prevent IDEs inserting BOM.

PR Checklist

xtqqczze avatar Aug 09 '20 22:08 xtqqczze

Remove UTF-8 BOM from text files.

My main concern is with this part; Windows PowerShell isn't going to like BOM-less UTF-8

rjmholt avatar Apr 21 '21 21:04 rjmholt

Instead, ps*1 files should probably have a BOM and other text files should not

rjmholt avatar Apr 21 '21 21:04 rjmholt

The configuration should match that, but generally looks good to me

rjmholt avatar Apr 21 '21 21:04 rjmholt

@xtqqczze after looking through your approach in this PR and thinking about some of the particulars of this repo, I've opened https://github.com/PowerShell/PSScriptAnalyzer/pull/1665, which goes a bit further and tries to clean up some of the strangeness in the PSSA repo.

In particular, it specifies more settings, uses UTF-8 with BOM for PowerShell files, and makes sure test assets (some of which are deliberately encoded or formatted differently) are put in a protected assets directory

rjmholt avatar Apr 23 '21 23:04 rjmholt

@rjmholt I will close once #1665 is merged.

xtqqczze avatar Jul 05 '21 21:07 xtqqczze