Skip to content

Generate components with UTF-8 encoding #13908

@felipedsc

Description

@felipedsc

🚀 Feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

Files are not generated with utf-8 encoding.
There was an issue about that opened in 2016 which was closed without providing a solution:
#2077.

When you generate a new component (ng g c test), the files are created using the encoding "Western European (Windows) - Codepage 1252" which is Windows' default .

Many people (including me) haven't faced this problem because Visual Code forces your file encoding to UTF-8. As one of our team members wants to use Visual Studio instead of Visual Code, it keeps the original encoding I mentioned previously, causing some problems on the template.

It seems that we cannot change windows default encoding and as I couldn't find any configuration or option (on "ng g c") to force generate UTF-8 files, I'm creating this request.

Describe the solution you'd like

I believe a configuration (angular.json?) would be the best solution.

Describe alternatives you've considered

Re-saving each file; using vscode; installing an extension for visual studio to force utf-8 also should work...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions