-
Notifications
You must be signed in to change notification settings - Fork 12k
Generate components with UTF-8 encoding #13908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I am not sure how to replicate the problem you are facing. Under the hood, the CLI/devkit uses Node JS However, when no special characters are found Node JS will set the charset to ascii and not utf-8. Visual Studio seems not to be respecting the |
hey @alan-agius4, considering that changing the encoding when there is no special characters is an expected behaviour, it is acceptable that it may be not CLI's responsibility. Thanks for making it clear for us, and, as I said before, I understand that it may not be Angular/CLI's responsibility. Sorry for any inconvenience caused. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)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...
The text was updated successfully, but these errors were encountered: