Skip to content

bug(migrations): Angular 20 update migrations stripping BOM from UTF8 files that have them #31263

Closed
@hamfastgamgee

Description

@hamfastgamgee

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

The Angular 20 migration for Material (presumably the one that fixes variable names) is changing files of various types (TS, CSS, HTML, and SCSS) en masse from UTF-8 to Windows-1252 encoding on Windows, even if there is otherwise nothing at all to replace in those files. I found bug #27057 which appears to be about a related problem in the old MDC migration,

Reproduction

Steps to reproduce:

  1. Migrate an existing Angular Material app on Windows to Angular 20 using "ng update".
  2. Um, why are we touching most of the files and changing their encodings?

Expected Behavior

If the migration has nothing to do to a file, it should do nothing to that file. And if it does happen to need to change a file for the variable token replacements, it shouldn't switch that file's encoding.

Actual Behavior

Dozens of files in my tree with no substantive changes but with encoding switched from UTF-8 to Windows-1252.

Environment

  • Angular:
    Angular CLI: 20.0.0
    Node: 22.14.0
    Package Manager: npm 11.3.0
    OS: win32 x64

Angular: 20.0.0
... animations, build, cli, common, compiler, compiler-cli, core
... forms, platform-browser, router

Package Version

@angular-devkit/architect 0.2000.0
@angular-devkit/core 20.0.0 (cli-only)
@angular-devkit/schematics 20.0.0
@angular/cdk 20.0.1
@angular/material 20.0.1
@schematics/angular 20.0.0
ng-packagr 20.0.0
rxjs 7.8.2
typescript 5.8.3
zone.js 0.15.1

  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions