lay295 / TwitchDownloader

Twitch VOD/Clip Downloader - Chat Download/Render/Replay
MIT License
2.72k stars 260 forks source link

Mixed files encoded with and without UTF-8 BOM #881

Closed superbonaci closed 11 months ago

superbonaci commented 1 year ago

Checklist

Edition

Both

Describe your issue here

Some files are coded with BOM:

./TwitchDownloaderCLI/Modes/Arguments/FfmpegArgs.cs: Unicode text, UTF-8 (with BOM) text

Other don't:

./TwitchDownloaderCLI/Modes/Arguments/ITwitchDownloaderArgs.cs: ASCII text

Looks like files with edited with different file editors or operating systems, and the are mixed up: Comparing changes shows changes to lines that weren't actually changed

Add any related files or extra information here

No response

ScrubN commented 1 year ago

If a handful of popular editors automatically mess with the BOM without user input, is there really any point for us to normalize all the BOMs?

superbonaci commented 1 year ago

It's a matter of consistency, it should compile just fine unless some later VS update forces to.

ScrubN commented 1 year ago

MSBuild removing BOM handling would be a pretty devastating breaking change, so I don't anticipate that ever happening.

superbonaci commented 12 months ago

Can .cs files be normalized to BOM in .gitattributes ?

ScrubN commented 11 months ago

No, the BOM cannot be normalize in .gitattributes. You can set the text encoding for the local working tree, but UTF-8 with BOM does not seem to be an applicable option and all the documentation and examples I found only mention UTF-16.