Fix copyright symbol encoding; force UTF-8-BOM encoding for C# files #526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
When opening some files in IDEs like Visual Studio or Rider, the developer gets notified that file was opened with UTF-8 encoding. In case of Visual Studio, it tells you that some characters were replaced with substitution character (�) and saving the file will not preserve the original contents; Rider also performs character replacement but preserves the original contents when file is saved.
Visual Studio 2022
Shows up as modal window, forces you to interact with it.
Rider
Shows up as notification in the notification bar above the code editor, can be ignored.
The reason why it's happening is that some files are encoded in ISO-8859-1 where the copyright symbol is a single byte (0xA9), which is incompatible with UTF-8 and forces an IDE or a text editor to perform the character substitution.
Changes
'
). Those were either not rendered or rendered as �, depending on IDE/text editor.Result
The developer doesn't get annoyed with notifications/popups and in case of Visual Studio one doesn't need to be careful not to accidentally commit the substitution character.