Skip to content

File encoding is not maintained when first line of file is a conditional statement #2217

@ajaybhargavb

Description

@ajaybhargavb

The file generated after doing dotnet new has a different encoding than what was in the original file for the template.

Repro:

  • Install dotnet 3.1 sdk
  • Unzip C:\Program Files\dotnet\templates\3.1.0\microsoft.dotnet.web.projecttemplates.3.1.3.1.0.nupkg and go to Web.ProjectTemplates/content/BlazorServerWeb-Csharp/
  • Verify the encoding of App.razor (It should be UTF-8 with BOM)
  • Now create a new app with dotnet new blazor
  • Open the generated App.razor and check its encoding

Expected:
UTF-8 with BOM

Actual:
Windows Codepage 1252

cc @phenning

Metadata

Metadata

Assignees

Labels

triagedThe issue was evaluated by the triage team, placed on correct area, next action defined.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions