Skip to content

[Repo] Remove BOM and xml meta-tag from all files #6645

@Nirmal4G

Description

@Nirmal4G

While #4779 tracks trailing white-space clean-up. This issue tracks removing BOM and xml meta-tag from all the file in the Repo.

Update EditorConfig

First, we should update EditorConfig to add charset and set it to utf-8 to prevent future files marked with BOM (Byte Order Mark).
We should also segregate files by category to enable charset or spacing changes one set at a time thereby reducing risk.

  • Add charset to EditorConfig
  • Segregate files by category

Remove BOM from all files in the Repo

As removing BOM from all the files at once is such a troublesome task; It could fix many lingering issues related to BOM files in MSBuild; It could also introduce regressions. Since, MSBuild have fixed several issues related to BOM; It may be not complete, with precaution, we'll remove BOM case by case basis knowing each category of BOM removed files won't cause trouble down the line!

  • Remove BOM from sources (cs) files
  • Remove BOM from scripts (cmd/bat/ps1) files
  • Remove BOM from project (*proj/Directory.Build.*) files
  • Remove BOM from shipping (props/targets/tasks/xml/xslt) files

Remove xmlns and meta-tags from all XML files in the Repo

As of MSBuild v15, xml/xaml build files doesn't need to specify the default xmlns though there were issues with temporary project generation (in WPF/Workflow) requiring xmlns. Since, those issues have been fixed, it's safe to remove them.

For xml meta-tag, the default has been utf-8 and v1 for so... long, I don't remember when. Thus, we don't need those meta-tag cluttering the top of the files.

<?xml version="1.0" encoding="utf-8"?>
  • Remove xml meta-tag from all xml (and xaml) files
  • Remove xmlns from all xml (and xaml) files when possible.

Notes

If there's anything I missed please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageHave yet to determine what bucket this goes in.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions